我視圖控制器(Passwordviewcontroller),我想用 「presentModalviewController」 顯示Ipad的presentModalViewController在一個視圖控制器
我有一個AppDeleage:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
,這裏是我的ViewController從中我想PasswordviewController到顯示:
-ViewDidLoad
{
self.passwordView = [[PasswordView alloc]initWithNibName:@"PasswordView" bundle:nil];
[passwordView setModalPresentationStyle:UIModalPresentationFullScreen];
[self presentModalViewController:passwordView animated:YES];
}
我試過一切,但它仍然不工作,有人有一個想法?
這是你的代碼的精確複製/粘貼? – phi
該AppDelegate是確切的代碼。 但ViewDidLoad有更多的事情要做,而不僅僅是顯示modalViewController。 我的ViewController有一個視圖,在該視圖中是WebViews,TableViews和ImageViews。 你需要更多的信息,請問 – verklixt
是否可以'ViewDidLoad'應該是'viewDidLoad'? – phi