Structuring an iPhone app with several views
<p>I am confused by the relationship between the appDelegate, MainWindow and the various views (and corresponding contollers). What I want to achieve is to immediately after app launch, hand control over to a "mainController" class that in turn loads the nib-files as needed (to minimize program logic in the app delegate). First, I need to load a login screen, and after successful login the application content, whose logic I have read ideally should reside outside the appDelegate, hence the "mainController" class.</p>

<p>Does the "mainController" need to be connected with a (blank) nib-file? Should this mainController subclass the UIViewController class albeit it holds no GUI contents on itself and be instanciated with [window addSubview:mainViewController.view]; [window makeKeyAndVisible]; ? Or should I use the alloc/init syntax. In which case, how do I reference the window from the (sub)views in order to add views programmatically?</p>

<p>Any hints, tips or tutorials would be helpful.</p>
