views:

461

answers:

1

I'm exploring the NavBar example from the iPhone dev center.

More specifically, I'm trying to understand where the MainViewController object is instantiated and I simply can't find where this is happening.

The only references to the MainViewController class is in AppDelegate, where there is a forward declaration and #import. However, removing these sentences doesn't affect the program whatsoever.

The object is probably created in the nib file, but again, I can't find it.

I really like the Xcode development environment. What I don't like, however, is that there are some many different places where objects can be created/connected that it makes it really hard to understand somebody else's code.

Any help will be appreciated.

+5  A: 

If you look in the MainWIndow.xib file and click the disclosure triangle next to "Navigation Controller", you'll see an instance of MainViewController. This was created by dragging a "View Controller" object from the Library and then changing its Class.

Ben Gottlieb
Got it. Thanks!
Martin Cote
Give that man a "Correct Answer!"
curtisk