I have the following code in a didFinishLaunchingWithOptions application where I want to present a modal view controller for user login.
LoginViewController_iPhone *loginViewController=[[LoginViewController_iPhone alloc]initWithNibName:@"LoginViewController_iPhone" bundle:nil]; UINavigationController *loginNavigationController=[[UINavigationController alloc]initWithRootViewController:loginViewController]; loginNavigationController.modalPresentationStyle=UIModalPresentationFullScreen; [self.window.rootViewController presentModalViewController:loginNavigationController animated:NO]; [loginViewController release]; [loginNavigationController release];
However, all I get is a blank white screen. If I substitute the following
self.window.rootViewController=loginNavigationController;
The login screen is displayed correctly. There is no other view controller assigned to the rootViewController property since the application is just starting. Do I need another view controller assigned for it to work?
source share