• 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: running code on quitting of a Foundation tool
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: running code on quitting of a Foundation tool


  • Subject: Re: running code on quitting of a Foundation tool
  • From: "Michael Ash" <email@hidden>
  • Date: Thu, 29 Jun 2006 10:22:32 -0400

On 6/29/06, Donald Hall <email@hidden> wrote:
I must not be looking in the right place. I have a Foundation tool
that I want to do some actions when it receives a 'quit' message. Is
there some way to get a method to run at this time? In AppKit there
is 'applicationWillTerminate'. Is there something similar in
Foundation?( I want to post a notification to the distributed
notification center that the tool is quitting.)

Unless you're running NSApplication in your tool (in which case you will get applicationWillTerminate:), a Foundation tool does not get a nice 'quit' message. These tools are generally terminated by sending a signal to them. It is possible to catch and react to that signal, but extremely difficult to do in a safe manner. See this page for more information on the hows and whys:

http://www.cocoadev.com/index.pl?SignalSafety

Mike
_______________________________________________
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


  • Prev by Date: RE: Help needed in NSSplitView
  • Next by Date: Re: Bind to element in dictionary in array
  • Previous by thread: running code on quitting of a Foundation tool
  • Next by thread: String with bytes
  • Index(es):
    • Date
    • Thread