Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating
Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating
- Subject: Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating
- From: Markus Spoettl <email@hidden>
- Date: Mon, 23 Jul 2012 23:49:54 +0200
On 7/23/12 9:34 PM, Kevin Perry wrote:
If there would be a way to tell NSDocument to forgo asking whether to save
a document if -isDocumentEdited returned YES, and instead just save it,
that would be a solution. All I want is a silent save, when only
preferences need to be saved (since I'm using file wrappers it would be
quick too because I'm only replacing the wrapper for my preferences).
I don't see how I could do that. Is there a way?
You're talking about the "Do you want to save changes to this document"
dialog when clicking the close button or quitting? The only way to bypass
that is to override canCloseDocumentWithDelegate:… check for your special
"-isDocumentEdited==YES, but don't show a panel" case, and invoke the
shouldCloseSelector (after writing the preferences file) without calling
super.
Thanks, I'll see if I can make this work, I'll report back.
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
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