在iphone中在横向模式下显示modalviewcontroller的问题?
问题描述:
我的应用程序由一个横向视图组成,我想放置一个模态视图,但问题与模态视图有关。它没有得到它的负载..代码是:在iphone中在横向模式下显示modalviewcontroller的问题?
-------------------- code here ---------- ------------
UIViewController * modalViewController = [[UIViewController alloc] init];
modalViewController.view = modelView1; [self presentModalViewController:modalViewController animated:NO];
[self performSelector:@selector(hideSplash)withObject:nil afterDelay:5.0];
PLZ好心帮我这个....
答
与我们的代码的问题,就是你与alloc-init
初始化它,而没有任何笔尖的名字。现在,当调用:
[self presentModalViewController:modalViewController animated:NO];
该视图将通过调用它的loadview方法加载本身,你一定没有。所以如果u确实想以同样的方式进行初始化,只是试运行的代码行:
modalViewController.view = modelView1;
后:
[self presentModalViewController:modalViewController animated:NO];
,如:
[self presentModalViewController:modalViewController animated:NO];
modalViewController.view = modelView1;
我认为这将然后工作。
希望这会有所帮助。
感谢,
madhup
thanx的答复,但它在这两个工作的方式得到了一个差异。问题。 – abhiTouchmagic 2010-04-07 07:43:30