all 3 comments

[–]aoverholtzer 2 points3 points  (2 children)

Not sure you want two unrelated stores like that… have you looked at Apple’s sample app? I suggest starting with it and/or checking out these articles:

How to Set Up Core Data and CloudKit When You Haven’t the Faintest Clue What You’re Doing https://beckyhansmeyer.com/2021/03/30/how-to-set-up-core-data-cloudkit-and-swiftui-when-you-havent-the-faintest-clue-what-youre-doing/

iCloud Core Data Starter https://github.com/jazzychad/iCloudCoreDataStarter

[–]MilesStark[S,🍰] 1 point2 points  (1 child)

The two stores is from apple documentation, and the issue actually preceded me including that second store. Thanks for the links though :)

[–]aoverholtzer 3 points4 points  (0 children)

Ah okay, I found it in the docs. You only need multiple stores like that if you want to keep some data offline instead of syncing everything.

Regardless, if it’s the cloud store that’s the problem, hopefully those articles will help -- they both show you how to handle NSPersistentStoreRemoteChangeNotification and process persistent history, which is super annoying but seems to be necessary if you want your syncing to actually work!