• 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: Apple Quit event custom handler not working : Beginner
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apple Quit event custom handler not working : Beginner


  • Subject: Re: Apple Quit event custom handler not working : Beginner
  • From: Matt Neuburg <email@hidden>
  • Date: Fri, 11 Mar 2011 07:52:25 -0800

On Fri, 11 Mar 2011 13:37:57 +0530, deovrat singh <email@hidden> said:
>Hi,
>
>I am trying to install a custom Apple quit event handler,but it is not
>working.
>After running the application I am choosing quit from the menu.
>I have not changed the default menu xib file provided by xcode on creating
>the cocoa application.
>
>
>Please tell me what am I doing wrong
>
>
>This class is the application delegate
>
>
>    @implementation appleEventHandlerAppDelegate
>
>    @synthesize window;
>
>    - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
>NSAppleEventManager *manager = [NSAppleEventManager
>sharedAppleEventManager];
> [manager setEventHandler:self
>andSelector:@selector(handleQuitAppleEvent:withReplyEvent:)
>forEventClass:kCoreEventClass andEventID:kAEQuitApplication];
>    }
>
>    - (void)handleQuitAppleEvent:(NSAppleEventDescriptor *)event
>withReplyEvent: (NSAppleEventDescriptor *)replyEvent {
>NSLog(@"Inside the quit event handler ");
>

My guess is that you are installing the quit event handler too soon - the framework is coming along and installing its own quit event handler *after* yours, and therefore is overriding yours. Try using delayed performance. m.

--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Book "Cocoa programming for Mac OS X" Third Edition
  • Next by Date: CoreFoundation object over-retained during finalization
  • Previous by thread: RE: Apple Quit event custom handler not working : Beginner
  • Next by thread: Book "Cocoa programming for Mac OS X" Third Edition
  • Index(es):
    • Date
    • Thread