• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CoreData relationship/KVC question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: CoreData relationship/KVC question
      • From: Jean-Nicolas Jolivet <email@hidden>
References: 
 >Re: CoreData relationship/KVC question (From: Jean-Nicolas Jolivet <email@hidden>)

  • Prev by Date: Custom UIView and Interface Builder
  • Next by Date: Re: CoreData relationship/KVC question
  • Previous by thread: Re: CoreData relationship/KVC question
  • Next by thread: Re: CoreData relationship/KVC question
  • Index(es):
    • Date
    • Thread