App with NSPersistentCloudKitContainer & Binary Data Attribute can't build

Trying to set up a test app using NSPersistentCloudKitContainer.

Once I got the container set up, got error that attributes must be Optional or provide a default value, which makes sense. Problem is I have one Entity that has a Binary Data field. The field has been marked as Optional.
However, the DataModelCompile build step complains that "Photo.image must have a default value" Also get a "CloudKit Integration" error along the same lines: "Photo.image must have a default value".


But there is no way to define a default value for a Binary Data attribute, so don't see a way to fulfill this.
Anybody got a clue or do you think its just something I should Radar?

Replies

I've also run into this issue. In looking over the code for the sample app, the Used with CloudKit checkbox in the Model's Default configuration is unchecked.


https://developer.apple.com/documentation/coredata/synchronizing_a_local_store_to_the_cloud?language=objc


If you check the checkbox, errors on Binary, UUID and Transformable fields are generated, as well as complaining about several default values. Perhaps then the errors in Xcode are just not finely tuned at this point? I'm going forward with the assumption the checkbox isn't actually needed unless there is more than one configuration.

It's something to look into, thanks!