ioscore-datacloudkit

CoreData with CloudKit: record types not showing in dashboard


I'm adding CloudKit support to my app via NSPersistentCloudKitContainer.

In developer portal, I added iCloud and Push notifications capabilities to my app identifier, downloaded a new provisioning profile and installed it on Xcode. In iCloud I checked "CloudKit support" and enabled a container for my app.

In my app target, Signing & Capabilities, I enabled Remote notifications and CloudKit, and checked the container.

Now I run my app with NSPersistentCloudKitContainer for all my Core Data stuff. I do tasks that create new managed objects. This is on my device on which I'm logged in with iCloud.

In the CloudKit dashboard I see my app's container but I see no evidence that any objects made it to the cloud. I'm on Development, I click on Record Types and I expect to see some of the "CD_..." from my entities. Only the Users record type shows up.

enter image description here

I reinstalled the app from scratch to see if the objects created earlier synced from the cloud but no, apparently there was nothing there.

Any ideas?

Update: On my device I'm logged in with my personal Apple ID. I'm enrolled in the developer program with that same ID. The app is NOT showing in the list of apps using iCloud.


Solution

  • Somehow I'd missed this step while creating the NSPersistentStoreDescription:

    description.cloudKitContainerOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: "blah")
    

    I'm not yet seeing it in the Dashboard because now I get an error about the DB model having incompatibilities with CloudKit! But that's another story.