Re: Hooking NSDocument close
Re: Hooking NSDocument close
- Subject: Re: Hooking NSDocument close
- From: Donald Brown <email@hidden>
- Date: Fri, 14 Jun 2002 13:57:54 -0500
WindowWillClose doesn't work if the app is just quitting, and writeToFile
won't work because I may not be writing the file. I think NSApp is looking
at the dirty state, brining up that dialog "You have three dirty files, want
to review, cancel, or quit".
It's a bit of a puzzler. I really miss not being able to read the class
source code like I could with PowerPlant.
Donald
on 6/14/02 1:39 PM, Matt Neuburg at email@hidden wrote:
>
On Wed, 12 Jun 2002 16:31:29 -0500, Donald Brown <email@hidden> said:
>
>
> I need to catch when my document is about to go away (so I can save the user
>
> position). I've overridden canCloseDocumentWithDelegate to save my info and
>
> then call [super canCloseDocumentWithDelegate...], and this works when the
>
> document is closed (by clicking in the window's close box or choosing close
>
> from the menu). But, when the app quits, it's not called. Is there some
>
> other place I should be patching?
>
>
Have you considered the windowWillClose: notification?
>
>
Alternatively, have you considered overriding writeToFile:ofType:?
>
>
m.
--
Donald Brown
email@hidden
http://www.eamontales.com
We have met the enemy and he is us - Pogo
_______________________________________________
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.