magicalpanda / MagicalRecord

Super Awesome Easy Fetching for Core Data!
Other
10.8k stars 1.8k forks source link

Getting duplicates when using iCloud and default data #1264

Open MattW86 opened 7 years ago

MattW86 commented 7 years ago

Hello,

I am testing Magical Record and quite happy with it so far. I am facing only one issue. Hope you guys can help me out.

I am using MagicalRecord with the iCloud container and I have some default data that I set up when the app is launched first time.

So far everything is fine.

Then I deleted the app and reinstalled it. After the first launch, I received the data from iCloud as well as my default data. So I got duplicated data.

I was thinking of using some sort of UDID for each entity but it could be a bit pain.

I was wondering if there is an easy way to fix this issue?

drewmccormack commented 7 years ago

No easy way. Whatever you do, you will probably need uuids. iCloud or Ensembles.

One advantage of Ensembles is that it takes care of migrating your data in and deduping for you. With iCloud, you need to do that yourself.

The iCloud sync is also deprecated. I expect Apple to come with a new solution at WWDC 2017.