an oldie but a goodie: observing properties of collected objects
an oldie but a goodie: observing properties of collected objects
- Subject: an oldie but a goodie: observing properties of collected objects
- From: Matt Neuburg <email@hidden>
- Date: Thu, 17 Jun 2010 12:21:51 -0700
- Thread-topic: an oldie but a goodie: observing properties of collected objects
This question is a FAQ, but I'm going to ask it anyway.
It has been well said by mmalc that "Observing a collection is not the same
as observing the properties of the objects in a collection." Specifically,
in that oh-so-common configuration, an NSMutableArray of MSMutableDictionary
objects, if every dictionary has a key @"name", I might like to get notified
thru KVO if a @"name" is changed. But there's no simple way to do that. I
could register as an observe of @"name" for every one of those dictionaries,
but this is hard to maintain as dictionaries are added to and removed from
the array (though, as mmalc shows, it can be done).
My question is, does anyone have a *simple* approach to this common problem?
(Assume I'm on iPhone OS where NSArrayController is absent.) What advice
should one give a newbie on this topic? Just curious - thx - m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
_______________________________________________
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