1
votes

Generating subclasses for 2 Entities with the option "Create NSManagedObject SubClass" Xcode creates 4 files ... well, i can't understand how to use functions created to manage relations

@interface Person (CoreDataGeneratedAccessors)

- (void)addPersonContactObject:(Contacts *)value;
- (void)removePersonContactObject:(Contacts *)value;
- (void)addPersonContact:(NSSet *)values;
- (void)removePersonContact:(NSSet *)values;

@end

This is interface only, have i to implement these methods? and when they can be useful ? I found that one to many relations are managed with NSSet... not a mutable object is my doubt something related with that ?

1

1 Answers

2
votes

You don't have to implement them, they are declared there to prevent compiler warnings as described here.

You'd use the *Object ones to add and remove individual items from the relationship, but it is usually simpler to manage that from the "one" side of the one-to-many relationship (that is, to set the person from the contact, not the other way round).