I have generated a new Tabbed Application using storyboards.
So far I have
TabBarController -> FirstViewController -> SecondViewController -> ModalViewController
I'm trying to open the modal view before showing the tabBarController. I added the following code on the AppDelegate.m
showModalView
is called from application:didFinishLaunchingWithOptions:;
- (void)showModalView
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
GSLoginViewController *loginView = [storyboard instantiateViewControllerWithIdentifier:@"loginView"];
[loginView setModalPresentationStyle:UIModalPresentationFullScreen];
[self.window.rootViewController presentViewController:loginView animated:YES completion:NULL];
}
And here the output I have:
Warning: Attempt to present <ModalViewController: 0x93670d0> on
<UITabBarController: 0x935d170> whose view is not in the window hierarchy!