Note that there are some explanatory texts on larger screens.

plurals
  1. POCan I use a UINavigationController as the detail view of a UISplitViewController?
    text
    copied!<p>I'm running into a problem with an iPad app where I would like to have UINavigationControllers in both of the views within a UISplitView. I've looked through other similar questions here, but most link to a tutorial online that doesn't completely solve the problem. Here's a 2-minute walkthrough to re-create the problem I'm having:</p> <ol> <li>Create a New Project in XCode, starting from the Split View-based Application template.</li> <li><p>Add the following NSLog statement as the first line within the DetailViewController's willHideViewController method:</p> <p>NSLog(@"toolbar: %@", toolbar);</p></li> </ol> <p>If you run the application now, the log will show that the DetailViewController's toolbar is alive and well. Now...</p> <ol start="3"> <li>Open MainWindow.xib and expand the SplitViewController.</li> <li>Drag a Navigation Controller from the library on top of the DetailViewController.</li> <li>Expand the new Navigation Controller and change the class of the UIViewController within to a DetailViewController.</li> <li>Ctrl-drag from the SplitViewController to the DetailViewController and assign it as the delegate.</li> <li>Save MainWindow.xib and run the app again.</li> </ol> <p>At this point, the detail view has a navigation bar and an empty toolbar. If you view the logs, you should find that the toolbar is null. Why is this? Am I missing some sort of connection in Interface Builder? Is the navigation bar the problem for some reason?</p> <p>Unlike the tutorial at <a href="http://www.cimgf.com/2010/05/24/fixing-the-uisplitviewcontroller-template/" rel="noreferrer">http://www.cimgf.com/2010/05/24/fixing-the-uisplitviewcontroller-template/</a>, I would like to keep both the navigation bar and the toolbar (preferably with the toolbar at the top when in portrait and not visible when in landscape), so that I still have a functional "Back" button when the iPad is in portrait orientation.</p> <p>Does anyone have any suggestions for fixing this problem? An example project with this sort of set-up would be ideal.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload