I am developing a iPAD app with a UITabViewController and some custom controllers initialized in the App Delegate.
I would like to show a Login screen to be shown before the user can get to the tabbar controller. However, when I try to present the LoginController modally, It doesn’t show up on the screen.
See the code below:
[tabBarController setViewControllers:viewControllers];
[[self window] setRootViewController:tabBarController];
LoginViewController *loginVC = [[LoginViewController alloc] init];
[[self tabBarController]presentModalViewController:loginVC animated:NO];
The screen now only shows the tabBarController? What am I doing wrong?
If I add the loginVC using [[self window]setView:loginVC.View], I see the login screen.
I don’t know why your code is not working, but
Have your try this?
(Just to be sure you did at some point:
self.tabBarController = tabBarControllerso your tabBarController isn’t just a local variable andself.really get to it.)