我的应用程序最近已经从crashlytics让这些崩溃的是仅在iOS9发生崩溃的iOS9用 - [NSPersistentStoreCoordinator _coordinator_you_never_successfully_opened_the_database_device_locked:]
致命异常:NSInternalInconsistencyException
这NSPersistentStoreCoordinator没有持久性存储(文件损坏)。它不能执行保存操作。
从报告中的最后一次通话是
-[NSPersistentStoreCoordinator _coordinator_you_never_successfully_opened_the_database_device_locked:]
,这是NSPersistentStoreCoordinator是如何创建的
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator{
if (_persistentStoreCoordinator != nil) {
return _persistentStoreCoordinator;
}
AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
NSURL *storeURL = [[delegate applicationDocumentsDirectory] URLByAppendingPathComponent:@"database.sqlite"];
_persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:self.managedObjectModel];
NSError* error = nil;
if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType
configuration:nil
URL:storeURL
options:@{NSMigratePersistentStoresAutomaticallyOption:@YES, NSInferMappingModelAutomaticallyOption:@YES} error:&error])
{
NSLog(@"Error adding persistent store. %@, %@", error, error.userInfo);
return nil;
}
return _persistentStoreCoordinator;
}
有人知道这可能是造成这些事故?
我会老老实实地在'NSLog'后添加一个'abort()'来确保这个问题被捕获为一个应用程序没有正确初始化时无用的时间的99.999%。 –
@ MarcusS.Zarra - 同意。 –
感谢您的接触,这似乎是最可能的原因。虽然有趣的是,它开始只发生在iOS9上,我也对[NSPersistentStoreCoordinator _coordinator_you_never_successfully_opened_the_database_device_locked:]意味着什么感兴趣。 – AWillian