• 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: The Quit menu item
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The Quit menu item


  • Subject: Re: The Quit menu item
  • From: "John C. Randolph" <email@hidden>
  • Date: Sat, 29 Dec 2001 16:36:27 -0800

On Saturday, December 29, 2001, at 04:26 PM, Ben Mackin wrote:
How do I add in some "cleanup" code so that everything exits as it
should?

Implement an -applicationShouldTerminate: method in your app's delegate.


- (void)applicationWillTerminate:(NSNotification *)aNotification

Sent by the default notification center immediately before the application terminates. aNotification is always an NSApplicationWillTerminateNotification. You can retrieve the NSApplication object in question by sending object to aNotification. Put any necessary cleanup code in this method.

applicationWillTerminate: does not get called for logout for power-off. See NSWorkspaceWillPowerOffNotification, which is sent for these events.

See Also: - applicationShouldTerminate:, - terminate:

-jcr

"Scientology is both immoral and socially obnoxious... it is
corrupt, sinister and dangerous." - Mr. Justice Latey, London 1984


References: 
 >The Quit menu item (From: email@hidden (Ben Mackin))

  • Prev by Date: The Quit menu item
  • Next by Date: Re: HTML Rendering
  • Previous by thread: The Quit menu item
  • Next by thread: Setting a file's icon
  • Index(es):
    • Date
    • Thread