1、 首先Command+N创建一个新的CoreData文件,按照想要的CoreData重新 Add Entity,再clear;
如果程序还是崩溃,就执行第二步
2、找到
if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options: nil error:&error])
,然后将 options中的nil 替换成
@{NSMigratePersistentStoresAutomaticallyOption:@YES, NSInferMappingModelAutomaticallyOption:@YES}
clear程序,再次运行