Am using a parent-child context syncing data with cloud kit. Am facing a problem of child overwriting the parent data. I know this is how it works but is there anything that can be done.
Below is the exact scenario.
Model
- Parent Entity : A
- Child Entity : B
A->>B is one to many relationship.
Context:
Parent Context (MOC) :- Used for CRUD operation by users.
Child MOC (CMOC) :- Used for syncing data from cloud kit.
Senario:
- A parent is deleted from child context
- A child for that parent is inserted on parent context.
If the save of child occurs, it overwrite the parent moc while leaving the newly inserted child without a parent.
So this leaves a child which don't have any reference parent.