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程序,再次運行