我们的一小部分 beta 测试人员收到以下错误,并且无法找到发生这种情况的线索:
托管对象存储无法创建持久存储协调器:
Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed.
(Cocoa error 256.)" UserInfo=0x1f5cd8b0
{NSUnderlyingException=authorization denied, NSSQLiteErrorDomain=23}
这发生在应用程序由于位置事件在后台启动之后以及当我们调用addPersistentStoreWithType
. 这就是我传递选项的方式:
NSDictionary *persistentStoreOptions = [NSDictionary
dictionaryWithObjectsAndKeys:
NSFileProtectionNone, NSPersistentStoreFileProtectionKey, nil];
NSError *error;
if (![_persistentStoreCoordinator
addPersistentStoreWithType:NSSQLiteStoreType
configuration:nil
URL:storeURL
options:persistentStoreOptions
error:&error]) {
...
}
关于为什么这只发生在一定比例的安装中的任何线索及其背后的原因?