1

I have a UINavigationController on some tab of a UITabBar. When I drill down into the navigation controllers tableViews, move it into the more-tab, and then select the entry in the tableview in the more-list, i get the viewController that was visible at the time i left the tab i moved. Clicking on the back-button gets me back to the more-list, with no possibility to get back to the initial root view controller.

It would be perfectly okay for me to have the root view controller appear when i click on the item in the more-list, but i have no idea how to get notified when my viewcontroller is moved, since i am developing a library, and so have no reference to the TabBarController.

Ahti
  • 1,420
  • 1
  • 11
  • 20

1 Answers1

0

One of the ways is to implement tabBarController:willEndCustomizingViewControllers:changed: method in UITabBarViewController delegate. And watch for it. If such thing happend then reset you viewController and navigationViewController. This remove your UINavigationController stack, but application will work correctly.

Alexander
  • 1,228
  • 2
  • 15
  • 29
  • Yup, i ended up with making it a requirement for using my library that the app using it sends -viewControllerWasReordered to the libraries singleton in `tabBarController:willEnd...`. in -viewControllerWasReordered i basically did excactly that ^^ – Ahti Feb 02 '12 at 00:43