• 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: 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


  • Follow-Ups:
    • Re: NSApplicationMain
      • From: Lance Bland <email@hidden>
References: 
 >NSApplicationMain (From: Lance Bland <email@hidden>)

  • Prev by Date: User acess
  • Next by Date: High-level overview of Cocoa - thoughts from a newbie
  • Previous by thread: NSApplicationMain
  • Next by thread: Re: NSApplicationMain
  • Index(es):
    • Date
    • Thread