Re: CoreData relationship/KVC question
Re: CoreData relationship/KVC question
- Subject: Re: CoreData relationship/KVC question
- From: Steve Steinitz <email@hidden>
- Date: Sat, 31 Jan 2009 09:11:52 +1100
Hi Jean-Nicolas
On 30/1/09, Jean-Nicolas Jolivet wrote:
Using that accessor I know I can do the following:
[aDepartment addEmployeesObject:anEmployee];
How would I do that using KVC ?
[[aDepartment primitiveValueForKey: @"employees"]
addObject: anEmployee];
might work.
I think the preferred way is something like:
NSMutableSet * employeeSet = [aDepartment
mutableSetValueForKey: @"employees"];
[employeeSet addObject: anEmployee];
Is that closer to what you want?
My point is... I don't want to subclass NSManagedObject for all my entities
I like to subclass them all -- in fact I use the generation gap
pattern and doubly subclass them -- but that's just me :) I've
tediously implemented generation gap by hand for about 50
entities but I recently discovered that Jonathan Rentzsch
generously provides mogenerator to do it automatically.
Cheers,
Steve
_______________________________________________
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