• 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: Listening for changes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Listening for changes


  • Subject: Re: Listening for changes
  • From: Andre Masse <email@hidden>
  • Date: Fri, 19 Dec 2008 12:39:51 -0500

Thanks for the great trick!

Andre Masse

On Dec 19, 2008, at 12:35, Ken Thomases wrote:

On Dec 19, 2008, at 11:06 AM, Andre Masse wrote:

Let's say I have a class (called it Client) that has 25 fields and need to be notified when any of these is modified. Do I have to do - observeValueForKeyPath for each of the 25 fields?

You can add one "fake" property, use +keyPathsForValuesAffecting<Key> to tell KVO that all of your other keys affect the value of this one property, and then observe that one key.


On Tiger, you'd have to use +setKeys:triggerChangeNotificationsForDependentKey: to tell KVO about the dependencies.

Cheers,
Ken


_______________________________________________

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: 
 >Listening for changes (From: Andre Masse <email@hidden>)
 >Re: Listening for changes (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Listening for changes
  • Next by Date: Re: [Q] How to let the pasteboard know a file type?
  • Previous by thread: Re: Listening for changes
  • Next by thread: Re: Listening for changes
  • Index(es):
    • Date
    • Thread