setValue:forKey: and to-many relationships
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