CloudKit and Core Data with multiple stores

I try to create a CloudKit and Core Data application in iOS13.


I want two stores, one local and one Cloud enabled store. I have created 3 entities in the xcdatamodel, "Favorite", "Statistic" and "NameItem". I have also created two configurations, "Local" and "Cloud", and added one entity to "Cloud" configuration and two entities to the "Local" configuration. The entity in the "Cloud" configuration has NO relationship to the other entities. But the two entities in the "Local" configuration has relationship to each other.


When I enable CloudKit for the Cloud configuration I get an error stating:


"CloudKit Integration: Statistic.nameItem destination entity NameItem is missing from these configurations: Cloud"

"CloudKit Integration: NameItem.statistics destination entity Statistic is missing from these configurations: Cloud"


But the entities "Statistic" and "NameItem" does only reside inside the Local configuration and doesn't have any relationship to the third entity "Favorite".


Is this a bug or am I doing something wrong?

Replies

This isnt really an answer... more a checklist in an attempt to help you narrow down tbe cause of your problem...


  1. In the Data Model Inspector, under Configuration, have you checked the "Used with CloudKit" checkbox for your "Cloud" configuration?
  2. A requirement to use a data model with CloudKit is that every relationship has an inverse set... have you set the inverse for both these relationships?


Regarding item 2, refer to the documentation under the subheading "Design a CloudKit-Compatible Core Data Model".