coreData -- 拖入其他程序的dataModel文件 導致崩潰

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



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章