The objective is for me to be notified when "toOne.attribute" changes (either 
by toOne changing or by the attribute changing).

Surely what I am doing is not getting the NSManagedObject to observe itself, 
but rather the observer is self and the "observee" is the to one relationship 
and it's attribute.

If I made it [toOne addObserver:self forKeyPath:@"attribute" options:0 
context:NULL], then I would have to separately keep track of when toOne 
changed, and update the observers, and also this is a simple case - sometimes I 
need to do "toOne.toOne.attribute".

Or maybe I'm missing something in how KVO works with key paths...

Gideon


On 09/08/2010, at 9:24 PM, Michael Swan wrote:

> Gideon,
> It looks like you have an NSManagedObject that is observing itself. If this 
> is in fact the case what is the objective? There may be a better way to 
> accomplish your goal if you let us know what it is.
> 
>> 
>> [self addObserver:self forKeyPath:@"toOne.attribute" options:0 context:NULL];
>> 
>> 

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to