A<<–>B
I had a one-to-many relationship in my app that was adding things to coredata, just fine.
But I switch to:
A<<–>>B
Still using the following code,
[A setValue:myValue forKey:@"aRelationshipToB"];
throws the error.
‘NSInvalidArgumentException’, reason: ‘Unacceptable type of value for to-many relationship: property = “RowersBoat”; desired type = NSSet;
I’m sure that I’m just missing something or just lack the knowledge about coredata, could anyone give me some direction here, or maybe write out just a bit of code. That would really help.
Thanks
It’s because many-to-many relationship requires set of objects (NSSet). Use this code instead: