I got a very headache problem while working on an iphone app. This app is UITabBarController based, and each controller for Tab is UINavigationController based.
In one “UINavigationController”, there are two Controllers (I called it A and B here) in this “UINavigationController” stack, when clicking the tab it will display “A”, in “A”, there is a button if you click will go “B”, if you click “Back” button in “B”, will go back to “A”. See images below (for client’s stake, I remove some parts)
controller – A

controller – B

The question is : the client want to display the “Setting” page every time when click “setting” Tab, it means if it’s on “Terms” page, when click “setting” tab, it should go back to “setting” page…
I have tried these codes –
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
{
return YES;
}
But I don’t know how to do next, how to compare to know the “setting” tab is clicked? And how to always display “setting” page..any advice is appreciated.
In your Terms controller (controller B in your example), just add this code: