views:

51

answers:

1

Hello,

I'm trying to understand how Cocoa does its thing. The Cocoa Template's App Delegate file is this:

#import "Dataminer_ClientAppDelegate.h"

@implementation Dataminer_ClientAppDelegate

@synthesize window;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    // Insert code here to initialize your application 
}

@end

I see no reference do the MainMenu.xib anywhere, just an the window IBOutlet.

Looking at main.m

int main(int argc, char *argv[])
{
    return NSApplicationMain(argc,  (const char **) argv);
}

This guy - NSApplicationMain - must be doing some magic. Is this documented somewhere?

Is there any way to disable all that and let me do things from scratch? (ie: load the XIB myself)

+3  A: 

Some of the best material I've found on this subject is here:

The first link goes so far as to try and recreate what NSApplicationMain() is doing under the hood.

Dave DeLong
Also, one could point out that NSApplicationMain will load the NSMainNibFile specified in your application's Info.plist.
Chris Hanson