Re: Implementing undo in custom model object for lots of properties
Re: Implementing undo in custom model object for lots of properties
- Subject: Re: Implementing undo in custom model object for lots of properties
- From: Graham Cox <email@hidden>
- Date: Tue, 08 May 2012 14:55:52 +1000
On 08/05/2012, at 1:17 PM, Ben Kennedy wrote:
> Well, that would require my controller to -addObserver:... on each of the collected objects, which I had earlier decided to avoid for various reasons. But that's a good technique for me to keep in mind, and is beginning to sound like possibly a better approach.
Indeed, but if you are willing to have your object "publish" a list of keys it wants to be undoable (as you already are), then you can iterate over them and do -addObserver: in a loop, so it might not be all that bad.
However, I think that the override to -willChangeValueForkey: is just as good.
--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