Re: How to get observe KVO changes to *every* key for an object?
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