• 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 of nested objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVO of nested objects


  • Subject: KVO of nested objects
  • From: Bruce Truax <email@hidden>
  • Date: Mon, 25 Oct 2004 20:46:08 -0400


I have an array (surfaceArray) containing an array of objects
(masterObject). Each masterObject directly contains a number of variables.
This object also containsa number of other objects of the type nestedObject
which themselves contain variables. All of the variable values in
masterObject are displayed in a table view and the variables in the
nestedObject's are displayed in subviews using bindings. This works fine.

I can observe all of the values in the table by calling

[surfaceArray addObserver:self
toObjectsAtIndexes: surfaceArrayIndexSet
forKeyPath:aKey
options:NSKeyValueObservingOptionNew
context:masterObject];

Once for each variable in masterObject. My problem is that I cannot figure
out how to observe the variables in the nestedObject. I have accessors for
each nestedObject in masterObject. I have tried to observe these accessors
but they are not changed when the contents of a nestedObject are modified.
It is not clear to me how to turn on observing for an object twice removed.

Bruce

_______________________________________________
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

  • Follow-Ups:
    • Re: KVO of nested objects
      • From: Scott Stevenson <email@hidden>
  • Prev by Date: NSBezierPath Maximum When Printing
  • Next by Date: Re: Determining the size of a directory Part 2
  • Previous by thread: NSBezierPath Maximum When Printing
  • Next by thread: Re: KVO of nested objects
  • Index(es):
    • Date
    • Thread