Kindly help me with this issue .
I am using tabbarcontroller in my App,
[tabBarController setViewControllers:tabs]; tabs Contain array of viewcontrollers (6 viewcontrollers).
It automatically created more button.
ISSUE
When I open any viewcontroller from more button and then open any other controller from index 0 to 2 , and then press more button it maintain the last opened viewcontroller .
For Example: more button tableviewcontroller
screen :
Now when i press Contacts let say
Now when user press any other tabbar like feature tab bar
Now when user go back to more tab it shows the contact's viewcontroller
But i want the app to poptorootviewcontroller when user back again to more tabbar , and simply more tableviewcontroller.
viewWillDisappear
is a valid workaround, and works, but adding it in all the viewControllers in 'More' might be cumbersome. You should take a look atUITabBarControllerDelegate
. @Siby's answer below is one better solution. Overriding that method ordidSelectViewController
is a better way, since you get the freedom to perform any operations/actions from within a single method. - n00bProgrammer