Swift教程_swift常见问题(0007)_Can't find model for source store

Swift教程_swift常见问题(0001)_CoreData: warning: Unable to load class named 'xxx' for entity 'xxx'

Swift教程_swift常见问题(0002)_完美处理SourceKitService Crashed异常,6.1.1大部分已经修复

Swift教程_swift常见问题(0003)_storyboard修改不生效

Swift教程_swift常见问题(0004)_swift代码不能自动提示和补全

Swift教程_swift常见问题(0005)_完美解决Cannot override 'dealloc'异常

Swift教程_swift常见问题(0006)_完美解决swift数组索引是变量时的内存溢出

Swift教程_swift常见问题(0007)_Can't find model for source store


问题描述:

coredata数据结构变了以后,再次运行会reason: Can't find model for source store。


解决方案:

var defaultStoreURL = NSBundle.mainBundle().URLForResource("coreDataName", withExtension: "sqlite")

重命名coreDataName,例如coreDataNameV1。
成功运行后,去ios simulator中找到该coreDataNameV1.sqlite文件,将初始化库结构改为这个库结构即可。


点击进入ooppookid的博客

你可能感兴趣的:(ios,sqlite,swift,迁移,simulator,coredata)