I have a CoreData project in which I have several objects witch several relationships.
One of them is an ordered To-Many relationship from an object A to many objects B.
I'm using the automatically configured obj-c classes which I use in my other Swift code with the help of a bridging header.
When I want to add objects B to a parent object A, my App crashes with:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSOrderedSet intersectsSet:]: set argument is not an NSSet'
Which I believe is because of the following code:
objectA.addBObject(objectB)
It's a function in the obj-c class of object A and the NSOrderedSet it refers to is declared like this:
@property (nonatomic, retain) NSOrderedSet *B; //The B objects
and the function:
- (void)addBObject:(B *)value;
How can I solve this error ? I've already read some threads but no one helped me.
Thank you !