iOS SDK UITabBarController only shows one of two UIViewControllers
I am trying to make an iPhone application with two tabs: One for the game, and one for the instructions.
However, when I add the UIViewControllers using
[_tabBarController setViewControllers:[NSArray arrayWithObjects:self.viewController, self.viewController2, nil] animated:NO]
it only shows the first one.
开发者_C百科I have tried simply setting the title property of each of my view controllers then adding them, I have tried doing
[_viewController setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"something" image:nil tag:0]]
And also tried doing the previous operation in the initWithNibNamed: bundle:
method.
Is viewController2 nil and it just didn't load? Make sure you have it properly connected when using IB.
精彩评论