Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Mac Programmer Help > Re: Cocoa Gotch...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 3710 of 3840
Post > Topic >>

Re: Cocoa Gotcha: NSApplicationMain never returns

by Sean McBride <cwatson@[EMAIL PROTECTED] > Apr 23, 2008 at 09:39 PM

In article <oster-2E60FB.13521818042008@[EMAIL PROTECTED]
>,
 David Phillip Oster <oster@[EMAIL PROTECTED]
> wrote:

> So what's going on here? Well, if you set a breakpoint on exit(), and 
> just quit the program you'll see that the Quit menu command calls 
> 
> [NSApplication terminate: ... ];
> 
> which in turn calls exit(). If you quit the program by logging out, the 
> Finder sends your program a "quit" appleEvent, you'll still go through 
> exit().
> 
> I was surprised by this behavior, since MFC, Powerplant, and Carbon all 
> normally cleanly terminate the runloop and return all the way out.

It's an optimisation to improve quitting speeds, so say the Cocoa folk.

When you quit an app, -dealloc is also not called for all the various 
live objects.

applicationWillTerminate: is often useful for situations like these.

Sean
 




 2 Posts in Topic:
Cocoa Gotcha: NSApplicationMain never returns
David Phillip Oster <o  2008-04-18 20:52:18 
Re: Cocoa Gotcha: NSApplicationMain never returns
Sean McBride <cwatson@  2008-04-23 21:39:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 1:17:08 CDT 2008.