• 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: [Q] which arrives earlier? applicationShouldTerminate or applicationWillTerminate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: [Q] which arrives earlier? applicationShouldTerminate or applicationWillTerminate
      • From: JongAm Park <email@hidden>
References: 
 >[Q] which arrives earlier? applicationShouldTerminate or applicationWillTerminate (From: JongAm Park <email@hidden>)

  • Prev by Date: Re: user-stoppable program
  • Next by Date: Re: [Q] which arrives earlier? applicationShouldTerminate or applicationWillTerminate
  • Previous by thread: [Q] which arrives earlier? applicationShouldTerminate or applicationWillTerminate
  • Next by thread: Re: [Q] which arrives earlier? applicationShouldTerminate or applicationWillTerminate
  • Index(es):
    • Date
    • Thread