As given in the plist the MainWindow is the Main nib file base name. So there is some hidden code which will be generated based on the plist to load the main window nib file on startup. This happens before didFinishLaunchingWithOptions.
As soon as the MainWindow nib is loaded there is a cascade of things that are done in the background, please refer to The Nib Object Life Cycle in the Resource Programming Guide.
One of those steps is
It unarchives the nib object graph
data and instantiates the objects.
Then almost finally it does:
It sends an awakeFromNib message to
the appropriate objects in the nib
file that define the matching
selector:
...
In iOS, this message is sent only to
the interface objects that were
instantiated by the nib-loading code.
It is not sent to File’s Owner, First
Responder, or any other proxy objects.
The first method you can get a grip on is awakeFromNib
.
To answer your three questions:
- During loading of the MainWindo nib file
- Yes, have a look at the nib file in interface builder
- It all happens before didFinishLaunchingWithOptions