尝试使用标准迁移更新核心数据时,应用程序崩溃而没有错误消息。它具有所有标准日志消息:
CoreData: sql: INSERT INTO ZENTRY(Z_PK, Z_ENT, Z_OPT, ZLOCATION, ZBOOKMARKED, ZCREATIONDATE, ZENTRYID, ZMESSAGE, ZSECTIONIDENTIFIER, ZTICDSSYNCID, ZVERSION) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
CoreData: sql: COMMIT
CoreData: sql: SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZISINPHOTOLIBRARY, t0.ZLARGETHUMBNAIL, t0.ZMOVIE, t0.ZORIGINALHEIGHT, t0.ZORIGINALIMAGE, t0.ZORIGINALWIDTH, t0.ZSCREENSIZEIMAGE, t0.ZTHUMBNAIL, t0.ZTYPE, t0.ZENTRY, t0.Z_FOK_ENTRY FROM ZMEDIA t0
它会在此停留几秒钟,然后崩溃到主屏幕,没有进一步的日志消息。
崩溃前的代码是:
persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
NSURL *storeUrl = [NSURL fileURLWithPath:storePath];
NSError *error;
NSDictionary *pscOptions = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
[NSNumber numberWithBool:NO], NSInferMappingModelAutomaticallyOption,
nil];
然后它在这一行崩溃:
if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeUrl options:pscOptions error:&error]) {
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
}
它甚至没有达到那个未解决的错误行。