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 protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to