Re: NSUndoManager retain/release of arguments - ad infinitum
Re: NSUndoManager retain/release of arguments - ad infinitum
- Subject: Re: NSUndoManager retain/release of arguments - ad infinitum
- From: Graham Cox <email@hidden>
- Date: Tue, 11 Jan 2011 21:48:36 +1100
On 11/01/2011, at 5:35 PM, Jerry Krinock wrote:
> But that assumes that the data was sorted with some old descriptors to begin with. It seems like this would not work if the objects had been manually arranged into some arbitrary order by the user.
True, but then you'd make the reordering step undoable (i.e. moveObject:toIndex: or similar registers with undo).
To make Undo really work for you, you have to make everything undoable, then all state changes in your data model are tracked and any given undo operates on a data state that is consistent with its own internal picture of the data. I suppose if all else fails you could simply make Undo take a snapshot of the data itself but that strikes me as potentially very inefficient.
--Graham
_______________________________________________
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