Re: NSApplicationMain
Re: NSApplicationMain
- Subject: Re: NSApplicationMain
- From: Christopher Lloyd <email@hidden>
- Date: Mon, 12 Nov 2001 13:10:49 -0500
Hi,
At 08:55 AM 11/12/2001 -0500, you wrote:
>
I would like the implementation for NSApplicationMain(). The documentation
>
in NSApplication is not specific enough. If anyone has that can they send
>
it to me?
Here is a rough implementation I use, no guarantees, but it is the essence
of the function:
int NSApplicationMain(int argc, const char *argv[]) {
NSBundle *bundle=[NSBundle mainBundle];
Class class=[bundle principalClass];
NSString *nibFile=[[bundle infoDictionary] objectForKey:@"NSMainNibFile"];
if(class==Nil)
class=[NSApplication class];
[class sharedApplication];
nibFile=[nibFile stringByDeletingPathExtension];
[NSBundle loadNibNamed:nibFile owner:NSApp];
[NSApp run];
return 0;
}
Hope this helps,
Chris