1

One of the tab bar controller tabs in my iPhone app changes what it displays based on where the user arrived from (which other tabs). For example, if the tabs are A, B, C and D, the C tab will display a picture if the user was previously on tab A, but text if the user was previously on tab B.

I'm not sure how to implement this without subclassing the TabBarController (which Apple documentation discourages). TabBarController has a property for currently active controller, and a list of all controllers in the tab bar, but no way to see the 'tab bar controller traversion tree/stack', so to speak. Any thoughts?

1 Answer 1

1

Instead of subclass UITabBarController you can set a delegate and keep track of the last selected view controller via

- (void)tabBarController:(UITabBarController *)tabBarController
    didSelectViewController:(UIViewController *)viewController;
1
  • Ah, why didn't i think of that. Perfect. Thank you so much! Apr 13, 2009 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.