I have an object A with a to-many relation to B. B has a property A that is the inverse relation to A's NSSet.
Pseudo code:
class A{ NSSet *bConnections; } class B{ A *aConnection; }
In the model I have set up the relationship as optional. For A, the relationship is defines as to-many, inverse of aConnection at B and delete rule cascade.
B is defined with optional, inverse of bConnection and delete rule nullify.
When I create the objects, and add a NSSet of Bs to A with [aInstance setValue:setOfBs forKey:@"bConnections"]
the inverse relation in B is not set automatically. What am I doing wrong? Should not it be updated automatically from Core Data?
The objects are inited with: initWithEntity:entityDescription insertIntoManagedObjectContext:managedObjectContext