在 iOS 中使用 NSPersistentCloudKitContainer 时获取错误堆栈跟踪
Getting error stack trace when working NSPersistentCloudKitContainer in iOS
我正在尝试使用 Core Data 和 CloudKit 构建一个非常基本的应用程序。我在我的 Mac 上登录了我的 CloudKit 帐户,然后按照说明 运行 Apple 在其 website.
上提供的示例项目
使用示例项目作为指南,我尝试使用提供的说明构建一个更简单的应用程序 here。
但是,在构建尝试 运行 我的示例项目后,我在控制台中收到以下错误堆栈跟踪:
CoreData: debug: CoreData+CloudKit: -[PFCloudKitOptionsValidator validateOptions:andStoreOptions:error:](35): Validating options: <NSCloudKitMirroringDelegateOptions: 0x60000097f960> containerIdentifier:iCloud.com.cybermedia.CloudKitTest1 initializeSchema:YES ckAssetThresholdBytes:<null> operationMemoryThresholdBytes:<null> useEncryptedStorage:NO automaticallyDownloadFileBackedFutures:NO automaticallyScheduleImportAndExportOperations:YES skipCloudKitSetup:NO preserveLegacyRecordMetadataBehavior:NO useDaemon:YES apsConnectionMachServiceName:<null> containerProvider:<PFCloudKitContainerProvider: 0x600002f602e0> scheduler:<null> notificationListener:<null> containerOptions:<null>
storeOptions: {
NSInferMappingModelAutomaticallyOption = 1;
NSMigratePersistentStoresAutomaticallyOption = 1;
NSPersistentCloudKitContainerOptionsKey = "<NSPersistentCloudKitContainerOptions: 0x600002d73960>";
NSPersistentHistoryTrackingKey = 1;
NSPersistentStoreMirroringOptionsKey = {
NSPersistentStoreMirroringDelegateOptionKey = "<NSCloudKitMirroringDelegate: 0x600001c7dc20>";
};
}
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _setUpCloudKitIntegration](355): <NSCloudKitMirroringDelegate: 0x600001c7dc20>: Successfully enqueued setup request.
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate checkAndExecuteNextRequest](1854): <NSCloudKitMirroringDelegate: 0x600001c7dc20>: Checking for pending requests.
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate checkAndExecuteNextRequest]_block_invoke(1866): <NSCloudKitMirroringDelegate: 0x600001c7dc20>: Executing: <NSCloudKitMirroringDelegateSetupRequest: 0x60000232c2a0> 6D32A278-F996-438D-AA8D-950F438F6402
2019-07-06 01:10:45.443340-0400 CloudKitTest1[14002:3818396] [error] error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke(769): <NSCloudKitMirroringDelegate: 0x600001c7dc20>: Failed to set up CloudKit integration for store: <NSSQLCore: 0x600001274000> (URL: file:///Users/fsyed/Library/Developer/CoreSimulator/Devices/2A838B6E-EF14-4F54-9230-7B747A6DDE9B/data/Containers/Data/Application/249463B2-7348-4DBA-9739-0DDEB0ECBA10/Library/Application%20Support/CloudKitTest1.sqlite)
Error Domain=NSCocoaErrorDomain Code=134400 "Unable to initialize without an iCloud account (CKAccountStatusNoAccount)." UserInfo={NSLocalizedFailureReason=Unable to initialize without an iCloud account (CKAccountStatusNoAccount).}
CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke(769): <NSCloudKitMirroringDelegate: 0x600001c7dc20>: Failed to set up CloudKit integration for store: <NSSQLCore: 0x600001274000> (URL: file:///Users/fsyed/Library/Developer/CoreSimulator/Devices/2A838B6E-EF14-4F54-9230-7B747A6DDE9B/data/Containers/Data/Application/249463B2-7348-4DBA-9739-0DDEB0ECBA10/Library/Application%20Support/CloudKitTest1.sqlite)
Error Domain=NSCocoaErrorDomain Code=134400 "Unable to initialize without an iCloud account (CKAccountStatusNoAccount)." UserInfo={NSLocalizedFailureReason=Unable to initialize without an iCloud account (CKAccountStatusNoAccount).}
2019-07-06 01:10:45.444373-0400 CloudKitTest1[14002:3818396] [error] error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate recoverFromError:](1259): <NSCloudKitMirroringDelegate: 0x600001c7dc20> - Attempting recovery from error: Error Domain=NSCocoaErrorDomain Code=134400 "Unable to initialize without an iCloud account (CKAccountStatusNoAccount)." UserInfo={NSLocalizedFailureReason=Unable to initialize without an iCloud account (CKAccountStatusNoAccount).}
CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate recoverFromError:](1259): <NSCloudKitMirroringDelegate: 0x600001c7dc20> - Attempting recovery from error: Error Domain=NSCocoaErrorDomain Code=134400 "Unable to initialize without an iCloud account (CKAccountStatusNoAccount)." UserInfo={NSLocalizedFailureReason=Unable to initialize without an iCloud account (CKAccountStatusNoAccount).}
2019-07-06 01:10:45.445456-0400 CloudKitTest1[14002:3818396] [error] error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _recoverFromError:withMonitor:](1398): <NSCloudKitMirroringDelegate: 0x600001c7dc20> - Failed to recover from error: Error Domain=NSCocoaErrorDomain Code=134400 "Unable to initialize without an iCloud account (CKAccountStatusNoAccount)." UserInfo={NSLocalizedFailureReason=Unable to initialize without an iCloud account (CKAccountStatusNoAccount).}
Recovery encountered the following error: (null)
CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _recoverFromError:withMonitor:](1398): <NSCloudKitMirroringDelegate: 0x600001c7dc20> - Failed to recover from error: Error Domain=NSCocoaErrorDomain Code=134400 "Unable to initialize without an iCloud account (CKAccountStatusNoAccount)." UserInfo={NSLocalizedFailureReason=Unable to initialize without an iCloud account (CKAccountStatusNoAccount).}
Recovery encountered the following error: (null)
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _finishedRequest:withResult:](1883): Finished request: <NSCloudKitMirroringDelegateSetupRequest: 0x60000232c2a0> 6D32A278-F996-438D-AA8D-950F438F6402 with result: <NSCloudKitMirroringResult: 0x600002304ea0>
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate checkAndExecuteNextRequest](1854): <NSCloudKitMirroringDelegate: 0x600001c7dc20>: Checking for pending requests.
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate checkAndExecuteNextRequest]_block_invoke(1869): <NSCloudKitMirroringDelegate: 0x600001c7dc20>: No more requests to execute.
我一直收到错误消息:
NSLocalizedFailureReason=Unable to initialize without an iCloud account
任何人都可以看到或帮助我确定我做错了什么吗?
您需要在模拟器上登录您的iCloud账户
我正在尝试使用 Core Data 和 CloudKit 构建一个非常基本的应用程序。我在我的 Mac 上登录了我的 CloudKit 帐户,然后按照说明 运行 Apple 在其 website.
上提供的示例项目使用示例项目作为指南,我尝试使用提供的说明构建一个更简单的应用程序 here。
但是,在构建尝试 运行 我的示例项目后,我在控制台中收到以下错误堆栈跟踪:
CoreData: debug: CoreData+CloudKit: -[PFCloudKitOptionsValidator validateOptions:andStoreOptions:error:](35): Validating options: <NSCloudKitMirroringDelegateOptions: 0x60000097f960> containerIdentifier:iCloud.com.cybermedia.CloudKitTest1 initializeSchema:YES ckAssetThresholdBytes:<null> operationMemoryThresholdBytes:<null> useEncryptedStorage:NO automaticallyDownloadFileBackedFutures:NO automaticallyScheduleImportAndExportOperations:YES skipCloudKitSetup:NO preserveLegacyRecordMetadataBehavior:NO useDaemon:YES apsConnectionMachServiceName:<null> containerProvider:<PFCloudKitContainerProvider: 0x600002f602e0> scheduler:<null> notificationListener:<null> containerOptions:<null>
storeOptions: {
NSInferMappingModelAutomaticallyOption = 1;
NSMigratePersistentStoresAutomaticallyOption = 1;
NSPersistentCloudKitContainerOptionsKey = "<NSPersistentCloudKitContainerOptions: 0x600002d73960>";
NSPersistentHistoryTrackingKey = 1;
NSPersistentStoreMirroringOptionsKey = {
NSPersistentStoreMirroringDelegateOptionKey = "<NSCloudKitMirroringDelegate: 0x600001c7dc20>";
};
}
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _setUpCloudKitIntegration](355): <NSCloudKitMirroringDelegate: 0x600001c7dc20>: Successfully enqueued setup request.
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate checkAndExecuteNextRequest](1854): <NSCloudKitMirroringDelegate: 0x600001c7dc20>: Checking for pending requests.
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate checkAndExecuteNextRequest]_block_invoke(1866): <NSCloudKitMirroringDelegate: 0x600001c7dc20>: Executing: <NSCloudKitMirroringDelegateSetupRequest: 0x60000232c2a0> 6D32A278-F996-438D-AA8D-950F438F6402
2019-07-06 01:10:45.443340-0400 CloudKitTest1[14002:3818396] [error] error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke(769): <NSCloudKitMirroringDelegate: 0x600001c7dc20>: Failed to set up CloudKit integration for store: <NSSQLCore: 0x600001274000> (URL: file:///Users/fsyed/Library/Developer/CoreSimulator/Devices/2A838B6E-EF14-4F54-9230-7B747A6DDE9B/data/Containers/Data/Application/249463B2-7348-4DBA-9739-0DDEB0ECBA10/Library/Application%20Support/CloudKitTest1.sqlite)
Error Domain=NSCocoaErrorDomain Code=134400 "Unable to initialize without an iCloud account (CKAccountStatusNoAccount)." UserInfo={NSLocalizedFailureReason=Unable to initialize without an iCloud account (CKAccountStatusNoAccount).}
CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke(769): <NSCloudKitMirroringDelegate: 0x600001c7dc20>: Failed to set up CloudKit integration for store: <NSSQLCore: 0x600001274000> (URL: file:///Users/fsyed/Library/Developer/CoreSimulator/Devices/2A838B6E-EF14-4F54-9230-7B747A6DDE9B/data/Containers/Data/Application/249463B2-7348-4DBA-9739-0DDEB0ECBA10/Library/Application%20Support/CloudKitTest1.sqlite)
Error Domain=NSCocoaErrorDomain Code=134400 "Unable to initialize without an iCloud account (CKAccountStatusNoAccount)." UserInfo={NSLocalizedFailureReason=Unable to initialize without an iCloud account (CKAccountStatusNoAccount).}
2019-07-06 01:10:45.444373-0400 CloudKitTest1[14002:3818396] [error] error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate recoverFromError:](1259): <NSCloudKitMirroringDelegate: 0x600001c7dc20> - Attempting recovery from error: Error Domain=NSCocoaErrorDomain Code=134400 "Unable to initialize without an iCloud account (CKAccountStatusNoAccount)." UserInfo={NSLocalizedFailureReason=Unable to initialize without an iCloud account (CKAccountStatusNoAccount).}
CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate recoverFromError:](1259): <NSCloudKitMirroringDelegate: 0x600001c7dc20> - Attempting recovery from error: Error Domain=NSCocoaErrorDomain Code=134400 "Unable to initialize without an iCloud account (CKAccountStatusNoAccount)." UserInfo={NSLocalizedFailureReason=Unable to initialize without an iCloud account (CKAccountStatusNoAccount).}
2019-07-06 01:10:45.445456-0400 CloudKitTest1[14002:3818396] [error] error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _recoverFromError:withMonitor:](1398): <NSCloudKitMirroringDelegate: 0x600001c7dc20> - Failed to recover from error: Error Domain=NSCocoaErrorDomain Code=134400 "Unable to initialize without an iCloud account (CKAccountStatusNoAccount)." UserInfo={NSLocalizedFailureReason=Unable to initialize without an iCloud account (CKAccountStatusNoAccount).}
Recovery encountered the following error: (null)
CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _recoverFromError:withMonitor:](1398): <NSCloudKitMirroringDelegate: 0x600001c7dc20> - Failed to recover from error: Error Domain=NSCocoaErrorDomain Code=134400 "Unable to initialize without an iCloud account (CKAccountStatusNoAccount)." UserInfo={NSLocalizedFailureReason=Unable to initialize without an iCloud account (CKAccountStatusNoAccount).}
Recovery encountered the following error: (null)
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _finishedRequest:withResult:](1883): Finished request: <NSCloudKitMirroringDelegateSetupRequest: 0x60000232c2a0> 6D32A278-F996-438D-AA8D-950F438F6402 with result: <NSCloudKitMirroringResult: 0x600002304ea0>
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate checkAndExecuteNextRequest](1854): <NSCloudKitMirroringDelegate: 0x600001c7dc20>: Checking for pending requests.
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate checkAndExecuteNextRequest]_block_invoke(1869): <NSCloudKitMirroringDelegate: 0x600001c7dc20>: No more requests to execute.
我一直收到错误消息:
NSLocalizedFailureReason=Unable to initialize without an iCloud account
任何人都可以看到或帮助我确定我做错了什么吗?
您需要在模拟器上登录您的iCloud账户