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
  •  | 
  •  

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.

有帮助吗?

解决方案

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

        [self.detailViewController.navigationController popToRootViewControllerAnimated:YES];

And it works expectedly with a push segue.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top