I have two Core Data entities: Parent
and Child
. Parent has to-many relationship to a Child
called children
. Inverse relationship from is Child.parent
. So parent has CoreDataGeneratedAccessors
: - (void)addChildrenObject:(Child *)value;
and - (void)addChildren:(NSSet *)value;
.
Problem: after I add Child(s) by using one of those accessors and save managedObjectContext parent.children
is empty. At the same time parent
property of every added Child
point to proper instance of Parent
and NSFetchedResultsController
fetches such children (predicate is parent = %@, <instance of Parent>
) well.
How can it be so? Just don't have a clue how to debug such a strange CoreData behavior.