Re: The Quit menu item
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