Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lsegev

macrumors newbie
Original poster
Mar 16, 2012
1
0
Hi developer's, i need help please,
I know that if i have rootViewController that start with tabBar i can create UITabBar like this:
Code:
UITabBarController *tabController = (UITabBarController *)self.window.rootViewController; 
tabController.selectedIndex = [defaults integerForKey:kOptionLastTabSelectedKey]; 
tabController.delegate = self;

But my problems is:
First, how can i create tabBar if the tabBar is not my rootView? my app start with login that is simple viewController, and after login the tabBar will appear.
Second, where should i create the tab bar, in appDelegate or some else?

Thank's!!!
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
According to Apple:
When deploying a tab bar interface, you must install this view as the root of your window. Unlike other view controllers, a tab bar interface should never be installed as a child of another view controller.

So, how to do a login view that appears before the tab view? I've had success by making the tab view the root view and then presenting the login view modally.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.