I needed to select an UITabBarItem located in the « More… » section, and I came to this solution:
To select a viewController of the tabBarController, I do the following (each tabBarItem has a tag) :
- (IBAction) showAnotherTab:(id)sender
{
int tag = [sender tag];
NSArray *viewControllers = [self.tabBarController viewControllers];
for (int i=0; i<[viewControllers count]; i++) {
int tabTag = [[[viewControllers objectAtIndex:i] tabBarItem] tag];
if (tag == tabTag) {
if (i < 4) {
[self.tabBarController setSelectedIndex:i];
} else {
[self.tabBarController.moreNavigationController
popToRootViewControllerAnimated:NO];
[self.tabBarController setSelectedIndex:4];
[self performSelector:@selector(selectMore:)
withObject:[viewControllers objectAtIndex:i]
afterDelay:0.0f];
}
}
}
}
//=====================================
- (void) selectMore:(UIViewController *)controller
{
[self.tabBarController.moreNavigationController
pushViewController:controller animated:NO];
}
This method is not perfect, since when you will see the « More… » navigationController flash before the new tabBar is displayed. I suppose that doing this in a modal should do the trick.