Re: CoreData relationship/KVC question
Re: CoreData relationship/KVC question
- Subject: Re: CoreData relationship/KVC question
- From: Jean-Nicolas Jolivet <email@hidden>
- Date: Fri, 30 Jan 2009 17:21:19 -0500
Thanks a bunch for the mogenerator tip!
Right now I still haven't subclass my managed objects, probably
because I'm still very early in my development stage, but this could
definitely be handy!
*bookmarked*.....
On 30-Jan-09, at 5:11 PM, Steve Steinitz wrote:
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
Jean-Nicolas Jolivet
email@hidden
http://www.silverscripting.com
_______________________________________________
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