gonzobrains
gonzobrains

Reputation: 8036

iOS: Cannot get view to display with Navigation Controller

I'm trying to display a controller loaded from a NIB in my navigation controller (iOS 4/Xcode 4), but it is not working. Interface Builder doesn't allow me to choose any of my nibs; when I try to manually type one I get this error:

warning: Unsupported Configuration: Navigation Controller NIB Name set to MyViewController.nib (This view controller is not intended to have its view set in this manner)

What's this all about? One thing to make note of: I manually added the Navigation Controller after creating a view-based project. I decided that I should use one after I had already created the project, instead of choosing Nav-based from the beginning. Perhaps I forgot a setting?

Upvotes: 1

Views: 1563

Answers (1)

lxt
lxt

Reputation: 31304

I think you're trying to set the NIB of the navigation controller itself.

This is not what you want to do: you instead want to set the nib of the root view controller of your navigation controller. To do this, you should expand the navigation controller via the navigation panel (the left hand panel with a list of all the objects in your current NIB).

Selected 'Root View Controller', and then set its NIB and class as appropriate.

The reason you're getting an error right now is you're actually trying to set the navigation controller's NIB, which XCode is quite rightly not letting you do.

Upvotes: 8

Related Questions