• 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
setValue:forKey: and to-many relationships
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

setValue:forKey: and to-many relationships


  • Subject: setValue:forKey: and to-many relationships
  • From: Dave DeLong <email@hidden>
  • Date: Thu, 22 Apr 2010 14:28:38 -0600

Hi everyone,

I'm working with some NSManagedObjects and relationships between them.  When my code runs, I generate the appropriate key based on the data that I'm parsing.  For non-relationship attributes, I can simply do:

[myManagedObject setValue:aValue forKey:key];

My question is about to-many relationships.  According to the Key-Value Coding guide, Core Data will generate an "add<Key>Object:" method for me.  I was wondering if there was a way I could add an object to this relationship without having to build the selector, kind of like an "addObject:forKey:" method.

Does a method like that exist? (I couldn't see on in the docs)  Or do I get to build the selector myself?

Thanks,

Dave

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: setValue:forKey: and to-many relationships
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: Filling edges of NSView-customized NSMenu
  • Next by Date: Re: NSApplicationMain question
  • Previous by thread: Re: UIResponder Woes
  • Next by thread: Re: setValue:forKey: and to-many relationships
  • Index(es):
    • Date
    • Thread