Problem solved.
When compared to another project I’m working on, I noticed something missing from the “Signing & Capabilities” under macOS App Sandbox…
Once I checked Outgoing Connections (Client), Xcode created a new entitlements file (oddly named "AppNameDebug.entitlements") and added the setting "Outgoing Network Connections = YES".
Following my next build and run, sync to CloudKit databases worked perfectly.
Can’t figure why this wasn’t required before. I didn't uncheck this and the previous entitlements file did not contain this line item before.
All I can suggest is that I added an #if DEBUG macro to my project around the same time, so maybe this triggered the requirement?
#if DEBUG
do {
// Use the container to initialize the development schema.
try container.initializeCloudKitSchema(options: [])
} catch {
// Handle any errors.
}
#endif
But main problem solved.
If anyone has an explanation that would be appreciated.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: