Re: NSUndoManager w/ Document based app
Re: NSUndoManager w/ Document based app
- Subject: Re: NSUndoManager w/ Document based app
- From: Kevin Perry <email@hidden>
- Date: Wed, 25 Jan 2012 14:38:40 -0800
Hi,
If your document class returns YES for +autosavesInPlace (which it hopefully is!), then the dirty dot is no longer used.
The dot used to suggest that what was in memory differed from what's currently on disk. With Lion's Autosave feature, the intent is to make it appear to the user that what's on disk and what's in memory are the same at all times. Hence, the dirty dot was removed, and the "Edited" text was added to the title bar (for non-Untitled documents) to instead more explicitly denote that the document's contents have been edited since last opened or saved.
-KP
On Jan 25, 2012, at 1:23 PM, Luc Van Bogaert wrote:
> Hi,
>
> I'm currently experimenting for the first time with NSUndoManager in a document-based app. I think I understand the most important basics, and have even succeeded in implementing some working code, where objects can be added or removed from an array property in some model object, which is a subclass of NSDocument, all with working undo/redo capability.
>
> One thing I don't quite understand is why my document windows won't display the 'dot' in the close button when the model array property changes, even though my documents seem to keep track of the edited state correctly when I close the windows, because closing a dirty document window brings up a save dialog as expected, and a unedited one does not.
>
> As I understand, this should automatically be taking care of by the undo manager, and I'm not supposed to send a updateChangeCount: message.
>
> Thanks for any advice.
>
> --
> Luc Van Bogaert
>
> _______________________________________________
>
> 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
_______________________________________________
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