Re: Validate NSDocument on Quit
Re: Validate NSDocument on Quit
- Subject: Re: Validate NSDocument on Quit
- From: Jonathan Mitchell <email@hidden>
- Date: Sun, 05 Oct 2014 18:21:53 +0100
On 5 Oct 2014, at 15:36, Keary Suska <email@hidden> wrote:
> I am trying to prevent a quit in a document-based app when data in a document is invalid. AFAICT when auto save is turned on none of the normal document closing methods are called, and when the app delegate is called, NSDocumentController shows no existing documents. It might also have to do with the "Ask to keep changes" preference. Has anyone figured out how to trap closing to prevent saving possibly invalid data?
>
In my own document app I have continuously updating bindings and validations that must be run between numerous fields.
Auto saving doesn’t really work in a situation like this unless you also persist the fact that a portion of the data is currently invalid and can configure the app to handle this when loading documents - all of which sounds ghastly.
In my case I keep autosaving off.
J
_______________________________________________
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