开发者

Cocoa magic? Where is my XIB being loaded?

开发者 https://www.devze.com 2023-01-08 10:44 出处:网络
I\'m trying to unde开发者_Python百科rstand how Cocoa does its thing. The Cocoa Template\'s App Delegate file is this:

I'm trying to unde开发者_Python百科rstand 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)


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

  • http://cocoawithlove.com/2009/01/demystifying-nsapplication-by.html
  • http://cocoawithlove.com/2008/03/cocoa-application-startup.html

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

0

精彩评论

暂无评论...
验证码 换一张
取 消