views:

18

answers:

0

I'm still fairly new to iphone development, but I'm in the process of moving away from Interface Builder, as I prefer to build views in code. When working in the MVC paradigm though, I'm trying to figure out the best places to 'start' M-ish things; in other words, where to start firing up my model objects and where's the most logical place for starting to build and keep track of my view hierarchy. IB was great for handling some of this automatically but as my projects get more complex I'm seeking more fine-grained resource control.

Currently, I'm having the app delegate begin by creating an initial view controller, and that in turn is creating model objects (in init? viewdidload? where's a good place for heavy lifting?) and the parent UIView for the whole view hierarchy (in -loadView, but I've also seen example code such as BubbleLevel on Apple's site using -viewDidLoad for this, why?).

Should the initial view controller be responsible for creating all the other view controllers?

If anyone can point to some apple views and view controller documentation that doesn't lean towards using IB, I'd be grateful. (I found the View Controller Programming Guide for iOS to be helpful but a bit brief)

Also, when programmatically creating the application's UIWindow in the main app delegate, as I mentioned above, applicationDidFinishLaunching: is creating the initial view controller, but what created the app delegate object? Was it NSApplicationMain(,,,@"appDelegateName")? That's the sense I get from the documentation, but it's not explicitly stated.