Search code examples
iosobjective-ccore-dataicloud

Duplicating CoreData records with iCloud sync


When core data syncs with iCloud, occasionally all of my records are doubled. I believe this happens on reinstall, where the app has not yet synced data, creates a new data set, and then iCloud syncs and there are double of each record for each model.

Is there a way to prevent this sort of behavior? Right now I'm checking every model on load and data sync for duplication, but this seems messy and hackish.


Solution

  • Trying to use just an iCloud store is folly. Data must be stored both locally and in iCloud, or you will run into serious problems.

    Use MagicalRecord if you want core data.