Let\'s say I have a UIButton
in one tab view in my iPhone app, and I want to have it open a different tab in the tab bar of the TabBarController
.
For cases where you may be moving the tabs, here is some code.
for ( UINavigationController *controller in self.tabBarController.viewControllers ) {
if ( [[controller.childViewControllers objectAtIndex:0] isKindOfClass:[MyViewController class]]) {
[self.tabBarController setSelectedViewController:controller];
break;
}
}