iOS / Master Detail : how to pop the subdetail view when switching detail from the master controller?

StackOverflow https://stackoverflow.com/questions/18450070

  •  26-06-2022
  •  | 
  •  

Question

I am still working on my iPad RSS Reader. It consists of 2 Views:

  • the Master view, where one can choose the Feed
  • The Detail View where all the posts of a given Feed appear

Whenever touching a Post Cell, I follow a segue which pushes a WebView on top of my Detail controller.

If I select another Feed in the Master View when I have such a Webview over my Detail View, it will load it, but below the displayed WebView.

How may I "empty" the Detail View (=pop its eventually pushed Web View) whenever switching Feeds?

Thanks for your help.

Was it helpful?

Solution

OK, I added the following in the Master Controller didSelectRowAtIndexPath:

        [self.detailViewController.navigationController popToRootViewControllerAnimated:YES];

And it works expectedly with a push segue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top