• 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: How to get observe KVO changes to *every* key for an object?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get observe KVO changes to *every* key for an object?


  • Subject: Re: How to get observe KVO changes to *every* key for an object?
  • From: Dan Wood - Discussion Lists <email@hidden>
  • Date: Sat, 14 May 2005 08:10:02 -0700

That's a little bit better, but only slightly ... it seems like it's two layers of complexity, not one ... though at least it is fewer lines of code. Any other suggestions out there?


On May 13, 2005, at 11:18 PM, Sherm Pendley wrote:

On May 14, 2005, at 12:37 AM, Dan Wood - Discussion Lists wrote:


I have a class with lots of properties that are modified with an inspector using bindings. I need to observe changes to *all* of the keys to have my view refresh itself (in a non-bindings way).


Would a dependent key work for you? Like this:

+(void) initialize {
[self setKeys: [NSArray arrayWithObjects: @"foo", @"bar", @"baz", nil]
triggerChangeNotificationsForDependentKey: @"somethingChanged"];
}


Then connect your observer to the "somethingChanged" property. Because "somethingChanged" is dependent on "foo", "bar", and "baz", the observer will be notified when any of those are changed.

sherm--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >How to get observe KVO changes to *every* key for an object? (From: Dan Wood - Discussion Lists <email@hidden>)
 >Re: How to get observe KVO changes to *every* key for an object? (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: Highlighting custom buttons when pressed, how?
  • Next by Date: Re: DocoaBrowser for 10.4?
  • Previous by thread: Re: How to get observe KVO changes to *every* key for an object?
  • Next by thread: Lazy evaluation of items in NSPredicates
  • Index(es):
    • Date
    • Thread