I want to conditionally display a login screen on launch of an ipad app. I don't want to make it part of a default segue, since they only need to login periodically, not every time.
There are numerous examples of my question, but they all seem to predate ios5. When I use storyboards, however, nothing seems to work.
To reduce this to its essence, * create a new single view application, using storyboard * add a new viewcontroller to the storyboard, give it an identifier of "loginScreen" * put a text label on each view to visually distinguish them. * in the appDelegate:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIStoryboard *storyboard = [self.window.rootViewController storyboard];
UIViewController *loginController = [storyboard instantiateViewControllerWithIdentifier:@"loginScreen"];
[self.window.rootViewController presentModalViewController:loginController animated:TRUE];
return YES;
}
From what I've seen of the examples, that should work. But it still consistently displays the original rootViewController's view. No errors though.
Can anyone point out the (probably small) thing I'm missing?