• 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: cocoa app from scratch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cocoa app from scratch


  • Subject: Re: cocoa app from scratch
  • From: Julien Jalon <email@hidden>
  • Date: Mon, 19 Jul 2004 07:05:18 +0200

Some very little tweaks:

On Jul 19, 2004, at 3:59, Public Look wrote:
[...]
/* setup things... you should also think about creating and
registering the main menu with [NSApp setMainMenu:] */
[...]
int main()
{
/* Create the autorelease pool */
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];


/* use a sub pool here to be sure autoreleased objects
created at setup time are released as soon as possible
(or else they will never be deallocated since they
will be registered to the never-to-be-released top-level
pool)
*/
NSAutoreleasePool *subPool = [[NSAutoreleasePool alloc] init];


/* here: [NSApplication sharedApplication]; (without the assignation) is sufficient */
/* Create the application object. */
NSApp = [NSApplication sharedApplication];

setup();


[subPool release];

/* run the main event loop until application terminates */
[NSApp run];


/* in facts, we never get here... terminating the application leads to a simple "exit(0)" */
/* We get here when the user closes the application terminates. */
[pointArray release];
[NSApp release]; /* free the app */
[pool release]; /* release the autorelease pool */
return(EXIT_SUCCESS);
}

--
Julien
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >cocoa app from scratch (From: "Ihar 'Philips' Filipau" <email@hidden>)
 >Re: cocoa app from scratch (From: Public Look <email@hidden>)
 >Re: cocoa app from scratch (From: Public Look <email@hidden>)

  • Prev by Date: Re: Cocoa Bindings and popups
  • Next by Date: Re: Cocoa Bindings and popups
  • Previous by thread: Re: cocoa app from scratch
  • Next by thread: Re: cocoa app from scratch
  • Index(es):
    • Date
    • Thread