您的位置:首页 > 移动开发 > IOS开发

coreData -- 拖入其他程序的dataModel文件 导致崩溃

2016-08-05 18:10 183 查看
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程序,再次运行
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios entity CoreData