• 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: Override Terminate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Override Terminate


  • Subject: Re: Override Terminate
  • From: Giovanni Donelli <email@hidden>
  • Date: Wed, 19 Oct 2005 20:55:23 +0200

There is no reason to override the terminare command.

you can easily use the method posted to the delegate of NSApplication.
An instance of NSApplication referring to your application is NSApp. so simply call


[NSApp setDelegate:obj];

where obj implements:

- (void)applicationWillTerminate:(NSNotification *)aNotification

An other way is use the NSApplication notification posted upon termination which is
NSApplicationWillTerminateNotification


here you have to register an observer with NSNotificationCenter

hope it helps,
Giovanni

On 19 Oct 2005, at 8:36 PM, email@hidden wrote:

Hi All,
I am sure this is basic, but I just can't figure it out. What I want to do is override the terminate command when the use quits my application. I want to do this so I can release some resources and perform some clean up.


Thanks in advance!
Kris
 _______________________________________________
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


_______________________________________________ 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
References: 
 >Override Terminate (From: email@hidden)

  • Prev by Date: Re: Override Terminate
  • Next by Date: Re: Override Terminate
  • Previous by thread: Re: Override Terminate
  • Next by thread: Re: Override Terminate
  • Index(es):
    • Date
    • Thread