Core data application, that Syncs user data from CloudKit.
We have two core data context
- Main Context :- UI (Insert, Update, Delete from User )
- Child Context :- That fetches changes from cloud kit and once done saves the changes to Main Context.
Problems:
Since its a parent-child setup the changes from parent do not get reflected in child. So while the child is syncing changes to CloudKit if the parent context get updated, then child is not aware of that changes.
Say child context is trying to upload a record A to CloudKit meanwhile if user modifies the same record as below
User updates :- the new updates are lost when child saves the record to parent.
User Deletes :- (we just mark it as deleted) the child re-saves the child since it do not get the property marked as deleted.
Question:
Can child somehow know of the parent updates? Can i refresh the object before i save?
In Parent-Child Setup does child always overrides parent changes without getting merge conflicts?