Am working with my first storyboard application and am having a problem. When I drag a navigation controller to my layout, the root controller always ends up as a table view controller, when all I want is just a basic view controller.
How do I keep the navigation controller from setting up the root view controller as a root table view controller?
Thank you.
This has changed sometime between Xcode 4.2 and 4.3.3. I had Xcode 4.2 on another computer running Snow Leopard, and adding a navigation controller sets up a regular view controller as the root view controller, but Xcode 4.3.3 on my main development machine running Lion behaves as you described–it adds a table view controller.
I’m not aware of any way to change this (maybe Xcode ninjas could hack some templates?), but of course you can just delete the table view controller and add a new regular view controller, and set its custom class. Then you Control-drag from the navigation controller to your new view controller, and select “Relationship – Root View Controller” from the pop-up menu (this used to say “… – rootViewController” in Xcode 4.2).
Erica Sadun’s “The iOS 5 Developer’s Cookbook” relies on the old Xcode 4.2 behavior in Chapter 4’s storyboard walkthrough, but I managed to complete it with no issues using the workaround I described above, which you probably have found already. But if not, hope this helps.