I have an object A, which have a property B. B is an object that have a property C of type int. Then in another object, I use KVO to observe object A with keypath B.C. If I change value of C, then I can receive notification fine. But if I assign another object to B, or allocate B to a new object, would I also receive notification?
Asked
Active
Viewed 30 times
1 Answers
0
It all comes down to what you mean by assigning or allocating another object to B. As far as I understand you have a variable named B that references the object you are observing. KVO works with objects, not variables so if you point your variable B to another object the KVO will remain in place and will not automatically extend to the other object. Hope this helps.

Ivan Karpan
- 1,554
- 15
- 20