I have a typical set of UITableViewController views. All views have a button that displays the model view. There is a button on this settings screen. I would like this button to reject the modal view and implement popToRootViewController in the UITableViewController navigationController.
Dismissing a modal look is easy:
[self dismissModalViewControllerAnimated:NO]
and it works great. I tried this to open the main UITableViewController:
[self.parentViewController.navigationController popToRootViewControllerAnimated:NO]
and nothing happens.
I can possibly implement a delegate for this to happen, but there are quite a few view controllers with the same settings button (with even more), so the preference will be to find a solution that does not require additional code in each view controller.
Many thanks!
source
share