I have a UITabBarController with a set of tabs. Some of them, when selected, show you a table. The cells of the table, if touched, bring the user to a detail screen of the object in the cell itself using a "pushViewController".
When I click to a different tab, and I am in the detail page, I see the new tab page. And this is fine. When I click back to the previous tab I would like to have shown again the table and not the detail page...
Is this possible?
Thanks!
It is possible. Code:
// Called when the user selected a tab. In iOS3+, called even when no change occurs.
- (void)tabBarController:(UITabBarController *)tabbarcontroller didSelectViewController:(UIViewController *)viewController
{
UINavigationController *nav = (UINavigationController *)viewController;
[nav popToRootViewControllerAnimated: NO];
}
Explanations: