Re: [Q] which arrives earlier? applicationShouldTerminate or applicationWillTerminate
Re: [Q] which arrives earlier? applicationShouldTerminate or applicationWillTerminate
- Subject: Re: [Q] which arrives earlier? applicationShouldTerminate or applicationWillTerminate
- From: Andrew Bowman <email@hidden>
- Date: Fri, 26 May 2006 00:10:23 -0700
On May 25, 2006, at 11:52 PM, JongAm Park wrote:
Hello.
I would like to terminate a thread when an application program quits.
So, I tried checking when the "Quit" is invoked. One simple
approach is to set a flag when applicationWillTerminate: or
applicationShouldTerminate is invoked.
I don't know which one is called first. So I put NSLog() into each
method.
It turned out that applicationShouldTerminated is called first.
However, Apple's document says that they are called immediately
before an application quit.
So, I am not sure if the order of calling is always preserved, or
sometimes it changes.
Is the applicationShouldTerminated called before
applicationWillTerminate always?
Thank you.
JongAm Park
It would be kind of silly to have applicationWillTerminate called
first, since there's a chance the termination won't take place due to
a return of NO in applicationShouldTerminate. I believe the ordering
you observed remains fixed.
- Andrew Bowman
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden