How do I programmatically switch to another tab and go to the first view in the navigation stack ?
I can switch to a different tab.
self.tabBarContro
Know this is an old one, but I was faced with a similar problem. I have 3 tabs in a tabViewController, each tab has a Navigation tree that can be drilled through. When a user switches tab, I need the rootviewcontroller of that tab presented. My solution was to add the following lines to those view controllers in the Navigation trees:
-(void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:YES];
DLog(@"Running %@ '%@'", self.class, NSStringFromSelector(_cmd));
[self.tabBarController.viewControllers[self.tabBarController.selectedIndex] popToRootViewControllerAnimated:YES];
}
If the user is in any of the views with the above code and switches tabs, the tab they left is popped to the root view, so when they come back everything is cool....