By the time this debug output is printed, I've loaded 2 store descriptions, into a NSPersistentCloudKitContainer, that both have the NSPersistentCloudKitContainerOptionsKey set, both with differing containerIdentifiers that exist in iCloud. Yet, attempting to initialize the schema fails saying none of my store descriptions in the coordinator are configured to use CloudKit. They definitely are configured in the MOM.
Other observations: I'm beginning to think it's not advisable to have 2 configurations in one MOM that both point to different iCloud containers, because Xcode tells me that I have to add entities from one CloudKit configuration into another CloudKit configuration in order to get it to compile. Yet the one configuration contains just a single entity with no relationships at all. So that's really unexpected. Will Core Data attempt to generate CKRecords in both containers for the entities that appear in both CloudKit configurations? Perhaps it's best to use seperate MOMs (and an associated NSPersistentCloudKitContainer) for seperate CloudKit container backed configurations/stores.
Any help, from anyone on this issue would be greatly appreciated.
2019-08-20 22:08:00.401657+0100 TerrestrialTester[78354:2511978] Initialization options: NSPersistentCloudKitContainerSchemaInitializationOptions(rawValue: 4)
CoreData: debug: CoreData+CloudKit: -[PFCloudKitOptionsValidator validateOptions:andStoreOptions:error:](35): Validating options: <NSCloudKitMirroringDelegateOptions: 0x6000037096c0> containerIdentifier:iCloud.com.terrestrialbytes.Terrestrial ckAssetThresholdBytes:<null> operationMemoryThresholdBytes:<null> useEncryptedStorage:NO automaticallyDownloadFileBackedFutures:NO automaticallyScheduleImportAndExportOperations:YES skipCloudKitSetup:NO preserveLegacyRecordMetadataBehavior:NO useDaemon:YES apsConnectionMachServiceName:<null> containerProvider:<PFCloudKitContainerProvider: 0x600001e18320> storeMonitorProvider:<PFCloudKitStoreMonitorProvider: 0x600001e18350> scheduler:<null> notificationListener:<null> containerOptions:<null>
storeOptions: {
NSAddStoreAsynchronouslyOption = 1;
NSInferMappingModelAutomaticallyOption = 1;
NSMigratePersistentStoresAutomaticallyOption = 1;
NSPersistentCloudKitContainerOptionsKey = "<NSPersistentCloudKitContainerOptions: 0x600001c55be0>";
NSPersistentHistoryTrackingKey = 1;
NSPersistentStoreMirroringOptionsKey = {
NSPersistentStoreMirroringDelegateOptionKey = "<NSCloudKitMirroringDelegate: 0x600002d0d220>";
};
}
CoreData: debug: CoreData+CloudKit: -[PFCloudKitOptionsValidator validateOptions:andStoreOptions:error:](35): Validating options: <NSCloudKitMirroringDelegateOptions: 0x600003703410> containerIdentifier:iCloud.com.terrestrialbytes.Appture ckAssetThresholdBytes:<null> operationMemoryThresholdBytes:<null> useEncryptedStorage:NO automaticallyDownloadFileBackedFutures:NO automaticallyScheduleImportAndExportOperations:YES skipCloudKitSetup:NO preserveLegacyRecordMetadataBehavior:NO useDaemon:YES apsConnectionMachServiceName:<null> containerProvider:<PFCloudKitContainerProvider: 0x600001e00710> storeMonitorProvider:<PFCloudKitStoreMonitorProvider: 0x600001e00730> scheduler:<null> notificationListener:<null> containerOptions:<null>
storeOptions: {
NSAddStoreAsynchronouslyOption = 1;
NSInferMappingModelAutomaticallyOption = 1;
NSMigratePersistentStoresAutomaticallyOption = 1;
NSPersistentCloudKitContainerOptionsKey = "<NSPersistentCloudKitContainerOptions: 0x600001c55ba0>";
NSPersistentHistoryTrackingKey = 1;
NSPersistentStoreMirroringOptionsKey = {
NSPersistentStoreMirroringDelegateOptionKey = "<NSCloudKitMirroringDelegate: 0x600002d014a0>";
};
}
2019-08-20 22:08:00.408956+0100 TerrestrialTester[78354:2511978] error: A Core Data error occurred.
2019-08-20 22:08:00.409321+0100 TerrestrialTester[78354:2511978] userInfo: {
NSLocalizedFailureReason = "Couldn't initialize CloudKit schema because no stores in the coordinator are configured to use CloudKit: (\n)";
}