Re: NSDocument autosavesInPlace + package file = no revert?
Re: NSDocument autosavesInPlace + package file = no revert?
- Subject: Re: NSDocument autosavesInPlace + package file = no revert?
- From: Quincey Morris <email@hidden>
- Date: Sat, 25 Feb 2017 10:57:37 -0800
- Feedback-id: 167118m:167118agYYG0F:167118s_YzIz8EEc:SMTPCORP
On Feb 25, 2017, at 10:41 , Markus Spoettl <email@hidden> wrote:
>
> I looked at what happens when the application quits and
>
> - (BOOL)revertToContentsOfURL:ofType:error:
>
> is called. The absoluteURL passed in is the original file URL. So it's not surprising that this call doesn't actually revert any change. It's the latest version that autosave put there, overwriting the original.
>
> Do I have to use +preservesVersions=YES make this work (this means, reverting actually does what it says)?
It seems to me there was a discussion about what happens when you quit with unsaved changes, and it seemed that the quit mechanism was doing things in the wrong order, so that you can’t actually prevent a save. (But I might be misremembering the exact nature of the discussion.)
It also seems to me that setting the preference to ask about closing documents, in combination autosavesInPlace==YES, produces a UI inconsistency. Surely the Revert button should be a Don’t Save button.
Also, the documentation for “preservesVersions” says:
> Returning false from this method disables version browsing and revertToSaved(_:), which rely on version preservation when autosaving in place.
IOW, you can’t expect reverting to revert in your situation.
_______________________________________________
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