I think I understood the first half of what you said, and can now see
why making number the receiver of addObserver was totally wrong.
But I seem to have a problem.
If I want to observe the property of an object, and in my case, it
turns out that the M and C are collapsed into a model-controller, then
it's basically a case of asking something to observe itself. In other
words, your "myFoo addObserver: self <THE CONTROLLER> forKeyPath:
@"number" becomes....
I tried that and got the same message as before (<receiver> may not
respond to addObserver), only this time the receiver is the controller
instead of number.
Is it not possible to collapse M and C for a case where you want to
track a simple text field. It seems it must be.
On May 14, 2008, at 5:11 PM, Ken Thomases wrote:
To illustrate:
@interface Foo : NSObject
{
NSNumber* number; // <-- This is NOT the property
}
// _These_ are the property:
- (NSNumber*) number;
- (void) setNumber:(NSNumber*)newNumber;