A fairly simple ModelContainer:
var sharedModelContainer: ModelContainer = {
let schema = Schema([
Model1.self,
Model2.self,
Model3.self
])
let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false, cloudKitDatabase: .automatic)
do {
let container = try ModelContainer(for: schema, migrationPlan: MigrationPlan.self, configurations: [modelConfiguration])
return container
} catch {
fatalError("Error: Could not create ModelContainer: \(error)")
}
}()
After upgrading to macOS 15 and disabling/enabling iCloud for the app the sync stopped working on Mac. The steps:
Go to System Settings > Apple Account > iCloud > Saved to iCloud > See all
find the App and disable iCloud. After this synced items are removed from the app and some errors thrown in the console ('..unable to initialize without an iCloud account...')
Re-enable the iCloud setting
This error appears in the console:
CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate resetAfterError:andKeepContainer:](612): <NSCloudKitMirroringDelegate: 0x6000020dc1e0> - resetting internal state after error: Error Domain=NSCocoaErrorDomain Code=134415 "(null)"
On macOS Sonoma the items are synced back to the app and the sync is restored, but on Sequoia they don't come back and the sync is not working.
I tried resetting the container, deleting all data - no help.
Submitted FB15455847