Re: Core Data: Custom to-many relationship setter not being invoked
Re: Core Data: Custom to-many relationship setter not being invoked
- Subject: Re: Core Data: Custom to-many relationship setter not being invoked
- From: Quincey Morris <email@hidden>
- Date: Tue, 23 Feb 2010 12:45:40 -0800
On Feb 23, 2010, at 11:08, Ken Tabb wrote:
> These last 2 theories were what I presumed, but you know how desperate the theories start to become after a while :)
Yeah, I know how that goes.
It sounds like it's bug reporter time. You're leveraging a "free" method of getting your relationships set up (using array controller behavior), but it's not happening in the expected way (using your custom accessors). Either there's something wrong with the behavior, or we're looking for the problem in the wrong place.
If you care to investigate further, though, there are still a couple of things you could try, to see if they are revealing in any way.
Add a method of (say) transferring an employee to a different department. Implement it in the following alternate ways, in turn:
1. By using the Employee's setDepartment method.
2. By calling your Department's custom add/remove Employee methods directly (to verify that they actually work, though this is not at issue so far).
3. By using standard KVO compliant techniques. Call the standard NSSet add/remove object methods on a mutable set proxy ([department mutableSetValueForKey: @"employees"]).
All three techniques should produce the same results, and should all end up at your Department custom accessor methods rather than at 'setEmployees:'.
_______________________________________________
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