Who is responsible for instantiating MainViewController in iPhone NavBar example

I am researching NavBar example from iPhone dev center.

Specifically, I'm trying to figure out where the MainViewController object is instantiated and I just can't seem to find where this is going.

The only references to the MainViewController class are in the AppDelegate, where there is a forward declaration and #import. However, deleting these sentences does not affect the program at all.

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

I really like the Xcode IDE. However, I don't like that there are several different places where objects can be created / linked, making it very difficult to understand another user's code.

Any help would be appreciated.

+1


source to share


1 answer


If you look at the MainWIndow.xib file and click the disclosure triangle next to Navigation Controller, you will see an instance of MainViewController. This was created by dragging and dropping a View Controller object from the library and then modifying its class.



+6


source







All Articles