I have the following layout of view controllers:
loginViewController -> tabBarViewController -> navigationViewController -> mainTableViewController -> logoutViewController.
\
--> navigationViewController -> secondaryTableViewController
If the user successfully logs in he goes to the first tab of the tabBarViewController which is itself the first viewController (the mainTableViewController) from a navigationViewController. Consider that this mainTableViewController shows several options, each one leading to its own viewController, being the logoutViewController one of the options.
In the logoutView i have a button to logout (cool uh?) and if logout succeeds I want to go back to the loginViewController.
I tried calling:
[self.navigationController popToRootViewControllerAnimated:NO];
from the logoutViewController but nothing happens. I searched other similar questions but most of them suggests the use of popToRootViewControllerAnimated. I don't think it's that simple since I have a navigationController pushed from a tabBarController pushed from a viewController. What's the best way of doing this?
I hope it's not too confusing. Thanks.