KVO of nested objects
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