Search code examples
iosipaduisplitviewcontrollermaster-detail

iPad master detail app - change detail view controller's content


I started to explore the UISplitViewController class with a new master detail project in XCode, and I would like to replace the detail view's content with another UIViewControllers. I wrote it in this way (self is the detail viewcontroller and controller is the uiviewcontroller which I want to replace the first one with):

self.view = controller.view;

My question is: is it a proper way, will Apple accept it? If it is not, how could I do it better?


Solution

  • I am also building an iPad app with Master - Detail View Controllers in a UIIntelligentSplitViewController. As UISplitViewController doesn't support well while changing to different orientations, using UIIntelligentSplitViewController solves the issue with orientation change. See more here.

    I have read on one of apple documentation and also a in best practices that we should use Only one MasterView and DetailView Controllers in entire app, and write code in such a way that all data are loaded in these two views according to the object selected.

    But loading all data in same detail view might be a lot of code. So, I am also in search for answer for efficiently writing code to load in same detail view controller. However currently I am implementing only two views to show net data.

    If there is any other efficient way to accomplish it, please do mention. Thanks.