Trying to create Private configuration in Core data and export it to Cl;oudKit private database with NSPersistentCloudKitContainer. As a first step, inside the core data model, created a new private configuration. Created a new entity which by default dets added to default configuration. Dragged the newly created entity from default configuration to the private configuration. It crashes. Am I doing this right? If so is it Xcode 13.3.1 bug ? and should I upgrade?
Once I get past this issue, I plan to load persistent stores to export/synchronize the new entity from core data private configuration to cloudkit private database, which will hopefully work.
container.loadPersistentStores(completionHandler: { (loadedStoreDescription, error) in
if let loadError = error as NSError? {
fatalError("###\(#function): Failed to load persistent stores:\(loadError)")
} else if let cloudKitContainerOptions = loadedStoreDescription.cloudKitContainerOptions {
if #available(iOS 14.0, *) {
if .public == loadedStoreDescription.cloudKitContainerOptions?.databaseScope {
self._publicPersistentStore = container.persistentStoreCoordinator.persistentStore(for: loadedStoreDescription.url!)
} else if .private == loadedStoreDescription.cloudKitContainerOptions?.databaseScope {
self._privatePersistentStore = container.persistentStoreCoordinator.persistentStore(for: loadedStoreDescription.url!)
}
} else {
// Fallback on earlier versions
}
}