• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Implementing undo in custom model object for lots of properties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Implementing undo in custom model object for lots of properties (From: Ben Kennedy <email@hidden>)
 >Re: Implementing undo in custom model object for lots of properties (From: Graham Cox <email@hidden>)
 >Re: Implementing undo in custom model object for lots of properties (From: Ben Kennedy <email@hidden>)

  • Prev by Date: Re: monitoring changes in a local property
  • Next by Date: [moderator] Reminder - Mac OS X 10.8 beta is under non-disclosure. Do not discuss here.
  • Previous by thread: Re: Implementing undo in custom model object for lots of properties
  • Next by thread: monitoring changes in a local property
  • Index(es):
    • Date
    • Thread