• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSApplicationMain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: NSApplicationMain (From: Christopher Lloyd <email@hidden>)

  • Prev by Date: How?
  • Next by Date: Schools?
  • Previous by thread: Re: NSApplicationMain
  • Next by thread: NSDrawer and DrawContent
  • Index(es):
    • Date
    • Thread