2

What I want to achieve is that I have a Core Data configuration that syncs with CloudKit and a configuration that does not get synced. There are some entities I don't want to sync. They should be stored locally only.

I've tried to create a separate configuration and unchecked Used with CloudKit. Now if I'm adding a new entity that should only be used by the local configuration it is always in the default configuration (that is synced with CloudKit) as well. I can't remove the entity from the default configuration though.

enter image description here

In that case Entity is also in the default configuration and therefore would get synced with CloudKit.

How can I achieve to store this entity only on the device?

gpichler
  • 2,181
  • 2
  • 27
  • 52

1 Answers1

1

The documentation for your use case is here: https://developer.apple.com/documentation/coredata/mirroring_a_core_data_store_with_cloudkit/setting_up_core_data_with_cloudkit

This documentation suggests, at the end, that you create two configurations, one to sync with CloudKit, and one without. It looks like the default configuration is not synced with Cloudkit.

Ch Ryder
  • 360
  • 3
  • 10
  • I’m already having a couple of entities in my default configuration and they are all synced with CloudKit. It also has the checkbox Used with CloudKit selected per default. – gpichler Apr 02 '20 at 19:48
  • 1
    I understand. I think what the documentation suggests, under 'Manage multiple stores', is that you do not sync your default configuration with Cloudkit. Instead you would create a separate configuration, called 'Cloud', where you sync a subset with Cloudkit. – Ch Ryder Apr 02 '20 at 19:56