I have a typical UITableViewController set of views. On all views is a button, which brings up a model view. On that Settings view is a button. I would like that button to dismiss the modal view and implement popToRootViewController on the UITableViewController’s navigationController.
Dismissing the modal view is easy:
[self dismissModalViewControllerAnimated:NO];
and that works fine. I’ve tried this to pop the main UITableViewController:
[self.parentViewController.navigationController popToRootViewControllerAnimated:NO];
and nothing happens.
I can probably implement a delegate to make this happen but there are quite a few view controllers with the same Settings button (with more to come) so a preference to find a solution that doesn’t require additional code in each view controller.
Many thanks!
Couldn’t find a solution like this, so I’ve implemented a protocol/delegate which works fine. Just:
in the delegate call.