Search code examples
objective-ciospushmaster-detail

iOS - undo push from Master split view


I have a master-detail view, that when you select some row in the master view, the data from detail changes.

And from the detail view, you can make a push to another view.

The problem is that when you are in this last view, if you select a new row from the master view, nothing happens, because the main detail is not being shown.

I've seen that this code could help me:

[self.navigationController popViewControllerAnimated:YES];

But only if it was called from that last view. I'm trying to undo the push from de master view. How can I solve it?

Thanks!


Solution

  • [detailViewController.navigationController popToRootViewControllerAnimated:YES];