I'm creating a persistent store coordinator like this:
NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Mydatabase.sqlite"];
NSError *error = nil;
__persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error])
The issue is that as soon as I issue a save on any managed object context it fails with the following error:
May 15 17:46:18 xx-iPad @WorkMail[2807] <Warning>: Core Data: annotation: -executeRequest: encountered exception = Updating max pk failed: with userInfo = {
NSSQLiteErrorDomain = 14;
}
May 15 17:46:18 xx-iPad @WorkMail[2807] <Warning>: Core Data: annotation: -executeRequest: encountered exception = Updating max pk failed: with userInfo = {
NSSQLiteErrorDomain = 14;
}
May 15 17:46:18 xx-iPad @WorkMail[2807] <Warning>: Core Data: annotation: -executeRequest: encountered exception = Updating max pk failed: with userInfo = {
NSSQLiteErrorDomain = 14;
}
This is one error, another erorr is error 21 with an authorization denied error.
When the passcode lock is not enabled, this does not occur. I am writing to core data from a background thread using a single persistent store coordinator.