I am navigating to Tab bar controller with 6 tabs from a RootViewController... I have created back button method in left navbar item which pops back all tab views to RootViewController... Problem arises when i try to pop the 5th or 5th tabview.. the back button doesnt work at all in MoreViewController, 5th tab and 6th tab...
Here's what works: 1)Pops back to RootView from 1 to 4 tabs
2)Pops back to RootView from More View (only first time it works)
3)Pops back to MoreView from 5th/6th View (only first time it works)
Here's what doesnt work: 1)Doesnt pop back to RootView from MoreView
What am i doing wrong?
- (void)viewDidLoad
{
...
self.tabBarController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonSystemItemDone target:self action:@selector(goBack)];
...
}
Code for goBack method written in each tab
-(void)goBack{
[self.navigationController popToRootViewControllerAnimated:NO];
}