We are getting the following error on a small portion of our beta testers and haven't been able to find a clue of why this is happening:
Managed object store failed to create persistent store coordinator:
Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed.
(Cocoa error 256.)" UserInfo=0x1f5cd8b0
{NSUnderlyingException=authorization denied, NSSQLiteErrorDomain=23}
This happens after the app is launched in the background due to a location event and when we call addPersistentStoreWithType
. This is how I'm passing the options:
NSDictionary *persistentStoreOptions = [NSDictionary
dictionaryWithObjectsAndKeys:
NSFileProtectionNone, NSPersistentStoreFileProtectionKey, nil];
NSError *error;
if (![_persistentStoreCoordinator
addPersistentStoreWithType:NSSQLiteStoreType
configuration:nil
URL:storeURL
options:persistentStoreOptions
error:&error]) {
...
}
Any clue on why this would happen only for a percentage of installs and the reason behind it?