• 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
KVO and Object Arrays
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVO and Object Arrays


  • Subject: KVO and Object Arrays
  • From: Jake Carter <email@hidden>
  • Date: Sat, 19 Apr 2008 22:13:43 -0700

Hey guys,

I have a KVO question. First, the setup:

Foo
   NSMutableArray *bars;

Bar
   NSString *name;
   int number;

AppDelegate
   NSMutableArray *foos;

So the AppDelegate will contain an array of Foo object and each Foo object will have an array of Bar objects. I want to be able to observe the bars from the AppDelegate to see when new bars are added or when a property changes in each bar object. I know I can use addObserver:forKeyPath:options:context: and add it to each key I want to observe, but is there a better way to do this? Maybe some KVO magic way to watch a whole tree of objects and their properties?

Thanks for any help,

:// Jake


_______________________________________________

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: KVO and Object Arrays
      • From: Sean Murphy <email@hidden>
  • Prev by Date: Re: Binding NSButton enabled state
  • Next by Date: Re: Implementing a Slightly Unusual NSTableView
  • Previous by thread: Re: NSPopupButton Bindings
  • Next by thread: Re: KVO and Object Arrays
  • Index(es):
    • Date
    • Thread