Re: Apple Quit event custom handler not working : Beginner
Re: Apple Quit event custom handler not working : Beginner
- Subject: Re: Apple Quit event custom handler not working : Beginner
- From: deovrat singh <email@hidden>
- Date: Fri, 11 Mar 2011 13:56:01 +0530
Still it is not working
On Fri, Mar 11, 2011 at 1:49 PM, Dianne <email@hidden>wrote:
> Can you try to add this one in your app delegate,
>
> - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)sender {
>
> return TRUE;
>
> }
>
>
> Thanks,
> sandianne
> ------------------------------
> *From:* deovrat singh <email@hidden>
> *To:* email@hidden
> *Sent:* Fri, March 11, 2011 4:07:57 PM
> *Subject:* Apple Quit event custom handler not working : Beginner
>
> 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 ");
>
> }
>
> @end
>
>
> My intention is to write a custom function for handling quit instead of
> using application should terminate.
>
> Thanks.
>
> Regards,
> --
> Deovrat Singh
> _______________________________________________
>
> 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
>
>
--
Deovrat Singh
MTS(Development)
Adobe Captivate
_______________________________________________
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