0

The answer on

Change detail view from MasterDetail iPad app using storyboard

seems to be what I'm looking for except that I'm having trouble understanding and configuring the additional Navigational Controllers that are generated from the IPad Master-Detail template in XCode.

The initial Controller is a Split View then that contains two Navigational Controllers, one each for their contained Master View Controller and Detail View Controller respectively. Still going through the learning curve here, but my understanding from my reading was that one Navigational Controller controls both the Master and any pushed down Detail Views.

Following the instructions in the earlier question I'm able to drag on a second detail View Controller connected with a replace seque from my second static Table View cell but I can't (and don't know whether I should) also associate it with a Navigational Controller. If I select this new View Controller and Embed In/Navigational Controller then another Navigational Controller is generated off the Split View to the new View Controller (and it doesn't work when run).

Thanks

Community
  • 1
  • 1
user1069528
  • 608
  • 1
  • 13
  • 27

1 Answers1

0

You need to embed your original detail view controller in the navigation controller.

Don't be confused about navigation controllers. A UINavigationController is a controller of view controllers, in this case structured hierarchically.

So you start with a root view controller wrapped by a navigation controller and then you can heap more view controllers on top of that. The navigation controller will help you create and destroy them as needed, and it provides a nice interface with back buttons etc.

Now, if you want to present a modal view controller (e.g. for editing an object) that has also child view controllers (e.g. for editing certain attributes of the object), you have to wrap it into its own navigation controller. This will provide you with a nice navigation bar you can use to dismiss it and to manage it's own view hierarchy.

Clear?

Mundi
  • 77,414
  • 17
  • 110
  • 132
  • I don't thing that's possible -- if you look http://stackoverflow.com/questions/10201070/embedding-an-existing-uinavigationcontroller-to-new-view-controllers – user1069528 May 30 '12 at 13:21
  • It is possible. I do this all the time with modal view controllers that might need follow up view controllers. The question you indicate does not address this particular issue. – Mundi May 30 '12 at 13:24
  • So you have a UiNavigationalController with multiple embedded UIViewControllers? Please detail how you do this. – user1069528 May 30 '12 at 13:26
  • There is no such thing as `UIController`. See my edit where I try to explain. – Mundi May 30 '12 at 13:32
  • I'm beginning to think that something has changed with UISplitViewControllers since the earlier problem posted was solved. – user1069528 May 30 '12 at 13:34
  • If you look at http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UISplitViewController_class/Reference/Reference.html it says: There are two main approaches you can take, A simple master-detail interface in which the detail view remains constant. In this configuration, a single view controller manages the detail view for the lifetime of the application ... A complex application in which the master and detail views (and corresponding view controllers) may change. .. you need a separate custom controller object ... – user1069528 May 30 '12 at 13:35
  • You haven't described how to have more than one sibling level UIViewControllers within a UINavigational controller. – user1069528 May 30 '12 at 13:41
  • Yes I have described it. You wrap the new hierarchical view controller into its own navigation controller. Your quote from the documentation is a little bit beside the point. Unfortunately, your specific problem is not addressed in this passage. – Mundi May 30 '12 at 22:27