Re: Strategy for acting on changes in child objects?
Re: Strategy for acting on changes in child objects?
- Subject: Re: Strategy for acting on changes in child objects?
- From: Seth Willits <email@hidden>
- Date: Wed, 6 May 2009 23:18:47 -0700
On May 6, 2009, at 10:55 PM, Graham Cox wrote:
I could be wrong, but I don't think this is possible. However, I
have solved this by minimising the tedium of having to register for
all those individual property observations as follows:
A. each observable object class exports a list of properties that it
thinks may be of interest to an observer. This is just an array of
strings (property names) returned by a class method.
B. A utility method iterates over that list and registers a
nominated observer against each one. There is also a complementary
de-observing method.
C. The observer calls the utility method on the child passing itself
as an observer.
I like it.
It's still a little "clunky" (on the child-side) but less-so than
other ideas I had, and feels more proper than the ones I've been using.
--
Seth Willits
_______________________________________________
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