Re: Temporarily disabling autosave
Re: Temporarily disabling autosave
- Subject: Re: Temporarily disabling autosave
- From: Jerry Krinock <email@hidden>
- Date: Mon, 22 Apr 2013 15:57:41 -0700
On 2013 Apr 22, at 09:43, Steve Mills <email@hidden> wrote:
> So to sum up, upon pausing autosave
which, per previous messages in this thread, I presume you do by sending the shared document controller -setAutosavingDelay:0.0. I'm surprised that this has any effect, because this method is "Available in OS X v10.4 and later", and is apparently part of the the old "Tiger" autosave mechanism.
But, OK. It's not marked as deprecated. Apparently Apple has tweaked this method to work for both the old "Tiger" autosave and the new "Lion" autosave. Surprising.
> I explicitly tell it to autosave if needed via autosaveWithImplicitCancellability, in writeToURL return NO and set a userCancelled error if autosave is paused, and in hasUnautosavedChanges return NO if autosave is paused. This seems to handle all the cases I've tested so far.
You should try each of these three tests while autosave has been *paused*.
• Activate another app.
• Close the document window.
• Quit the app.
Debug -[NSDocument autosaveWithImplicitCancellability:completionHandler:] during this test. If this message is received, examine the implicitlyCancellable parameter and see if it is NO. Receiving that message with parameter NO is the most difficult case you need to handle, or else convince yourself that it can't happen.
_______________________________________________
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