Re: Observing related attributes via a to-many relationship
Re: Observing related attributes via a to-many relationship
- Subject: Re: Observing related attributes via a to-many relationship
- From: mmalc crawford <email@hidden>
- Date: Sun, 20 May 2007 19:52:55 -0700
On May 20, 2007, at 11:02 AM, email@hidden wrote:
[value addObserver:self
forKeyPath:@"toDetail.converted"
If 'toDetail' is a key of 'self', then the keypath should just be
"converted".
I've created a corresponding removeObserver: method within the
removeToDetailObject method. I've also added an
observeValueForKeyPath method to 'Master'. None of this works. I
can't see the observer registration method being called when new
Detail objects are added.
How are you adding the Detail objects? I'd guess using bindings, in
which case you're probably hitting this bug:
<http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdTroubleshooting.html#//apple_ref/doc/uid/TP40002320-DontLinkElementID_35
>
"Custom relationship set mutator methods are not invoked by an array
controller".
Remedy: You can work around this by adding self to the contentSet
binding's key path. For example, instead of binding to [Department
Object Controller].selection.employees, you would bind to [Department
Object Controller].selection.self.employees.
mmalc
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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