I’m syncing a core-data app with iCloud and none of the documentation says in what circumstances you’d choose one NSMergePolicy over the other. I’m using NSMergeByPropertyStoreTrumpMergePolicy, but I sometimes get random deletions. Is there another one I should be using?
Share
ntesler,
Each merge policy has different goals. I always default to background threads using
NSMergeByPropertyStoreTrumpMergePolicyand have the main thread useNSMergeByPropertyObjectTrumpMergePolicyType. The main time the these policies matter is when you are calling-refreshObject:mergeChanges:. When you setmergeChangesto YES, then the respective truth is chosen as directed by the policy.I’ve not used iCloud and hence cannot advise you on if it changes the above analysis. In my experience though, you need to choose one repository to be the “truth”. Is the iCloud always the truth? I expect it should be.
Andrew