CloudKit and CoreData Default Values

Viewed 1283

I'm setting up core data using an NSPersistentCloudKitContainer so that my data will automatically have CloudKit integration. The problem I'm having is that I can no longer have optional attributes in my entities. All of my optional attributes generate a compiler error

[entity].[attribute] must have a default value

Is this a bug? Is there a good work around for this issue?

2 Answers

It seems to be fixed in Xcode 11 beta 3.

The "solution" is just to make all links optional. On the XCode 11 GM this is still the same, don't think its "fixed" in any xcode beta.

I think the reason is that the way it syncs to CloudKit, they want to have full control of syncing by entity types, hence there might be short period of time where the link are broken.

Related