Im a newbie in xcode. I am start making a new Application that users can buy stuff from. There is a ViewController which is the login page – When the users typed the correct username and password and clicked on a button, the App will link the user to the TabBarController.
Here’s my code that I used to link the tabBarController:
- (void) LoginActionClicked {
//MainViewViewController is the TabBarController.
MainViewViewController *main = [[MainViewViewController alloc] initWithNibName:nil bundle:nil];
[self.navigationController pushViewController:main animated:YES];
}
When I run the program the link seemed to work fine but the tabBarController turned out black and the tab bar didn’t work.
Thanks for your help! 🙂
From the documentation: “Unlike other view controllers, a tab bar interface should never be installed as a child of another view controller.”
You will probably have better luck if you make the tab bar controller the root controller and then show the login controller over it modally until the user finishes with it.