Re: Quit Application doesn't send window close methods
Re: Quit Application doesn't send window close methods
- Subject: Re: Quit Application doesn't send window close methods
- From: Ted Lowery <email@hidden>
- Date: Wed, 1 Jan 2003 09:15:09 -0500
Hi again-
Thanks for the help, this worked. I don't want to start a flame war
here, but I do have an opinion that I want to share and see if it is
off base.
I notice when I look at the docs for -applicationWillTerminate, it says
The applicationWillTerminate: method does not get called for logout for
power off. See NSWorkspaceWillPowerOffNotification, which is sent for
these events. Now this strikes me as [insert flame target here].
Seems if the window is going to close, it should consistently send the
same messages, so as a programmer, I don't have to build a state
machine which captures all the different ways this could happen.
What's to keep the framework from adding something in a future release
that adds yet another way a window can be closed with yet a different
delegate method.
Is this too much to expect from a 10+ year old framework? Is there a
good reason why the framework would not send -windowDidResignKey EVERY
TIME, regardless of the instigator?
Cheers and Happy New Year all.
-Ted
On Wednesday, January 1, 2003, at 01:51 AM, David Rio Vierra wrote:
>
Well, you have two ways of doing this. In your app controller, which
>
is a delegate of NSApp, implement -applicationWillTerminate: and do
>
cleanup code there. You may also register some of your objects for
>
the NSApplicationWillTerminateNotification so they can do their own
>
cleanup.
>
>
- Rio
>
>
>
On Tuesday, December 31, 2002, at 04:47 PM, Ted Lowery wrote:
>
>
> Hi all-
>
>
>
> I've noticed when I quit my application, I don't get any delegate
>
> messages, things like windowShouldClose, windowWillClose or
>
> windowDidResignKey.
>
>
>
> What is the right way to trap for an application quitting so I can
>
> clean up? If I close the window first, clean up happens, as I
>
> override windowDidResignKey method.
>
>
>
> Thanks, Ted
>
> _______________________________________________
>
> cocoa-dev mailing list | email@hidden
>
> Help/Unsubscribe/Archives:
>
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.