• 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
Re: KVO and Core data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KVO and Core data


  • Subject: Re: KVO and Core data
  • From: Gideon King <email@hidden>
  • Date: Mon, 9 Aug 2010 22:42:51 +1000

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 (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: KVO and Core data
      • From: Dave Fernandes <email@hidden>
References: 
 >Re: KVO and Core data (From: Michael Swan <email@hidden>)

  • Prev by Date: Re: KVO and Core data
  • Next by Date: Re: KVO and Core data
  • Previous by thread: Re: KVO and Core data
  • Next by thread: Re: KVO and Core data
  • Index(es):
    • Date
    • Thread