I have 2 tab bar items. The first tab have a navigation controller(3 views) within.
Say I am on the 3rd vie开发者_Go百科w of the navigation controller, how do I load the 2nd tab.
So you want to switch from the first tab to the second tab. Well you first you need to acces the tabbarController. Most of the time you would have the tabbar controller in AppDelegete. Calling the delegate like this:
MyAppDelegate *delegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
Then the just set the selectIndex:
[delegate.tabBarController setSelectedIndex:1];
or
[delegate.tabBarController setSelectedViewController:self.secondViewController];
精彩评论