Re: NSApplicationMain
Re: NSApplicationMain
- Subject: Re: NSApplicationMain
- From: Lance Bland <email@hidden>
- Date: Mon, 12 Nov 2001 13:30:18 -0500
Christopher-
Thanks for that code. I think that is not accurate enough for what I
need. There is something going on before the call to sharedApplication
that I would like to know about. Apple use to publish the implementation
for NSApplicationMain().
-lance
email@hidden
On Monday, November 12, 2001, at 01:10 PM, Christopher Lloyd wrote:
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
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev