• 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
an oldie but a goodie: observing properties of collected objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: an oldie but a goodie: observing properties of collected objects
      • From: Ken Thomases <email@hidden>
    • Re: an oldie but a goodie: observing properties of collected objects
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: Add button to Finder
  • Next by Date: Re: an oldie but a goodie: observing properties of collected objects
  • Previous by thread: Re: mutableArrayValueForKey: truth or dare
  • Next by thread: Re: an oldie but a goodie: observing properties of collected objects
  • Index(es):
    • Date
    • Thread