Re: setPrimitiveValue:forKey: and to-many relationships
Re: setPrimitiveValue:forKey: and to-many relationships
- Subject: Re: setPrimitiveValue:forKey: and to-many relationships
- From: "Sean McBride" <email@hidden>
- Date: Wed, 24 Sep 2008 20:30:13 -0400
- Organization: Rogue Research
On 9/24/08 5:01 PM, Quincey Morris said:
>> - (void)setChildren:(NSSet *)value_
>> {
>> [self willChangeValueForKey:@"children"
>> withSetMutation:NSKeyValueSetSetMutation
>> usingObjects:value_];
>> [[self primitiveChildren] setSet:value];
>> [self didChangeValueForKey:@"children"
>> withSetMutation:NSKeyValueSetSetMutation
>> usingObjects:value_];
>> }
>
>This is more direct than either of my suggestions. However, my guess
>is that [[self primitiveChildren] setSet:value] does not maintain the
>inverse relationship, if you have one.
You're suspicion may be correct, but considering how this doc implements
addEmployee: I'm not so sure:
<http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/
Articles/cdAccessorMethods.html#//apple_ref/doc/uid/TP40002154-SW6>
Surely their example would not screw up inverse relationships, since
they also recommend one always have inverses...
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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