您的位置:首页 > 运维架构

The model used to open the store is incompatible with the one used to create the store

2015-10-21 23:18 537 查看
原文 http://www.entlib.net/?p=2516在iOS 6 – Core Data 应用程序的开发过程中, App启动时出现如下异常信息:reason = “The model used to open the store is incompatible with the one used to create the store”出现上述异常的原因是 :我们修改了Data Model文件,增加了新的Entity,包括Attribute属性、Relationship关系等等。解决办法:(1) 最简单的办法是,在iOS 5 或者 6的模拟器中,删除App,然后重新运行就可以了。(2) 第二种办法是使用Data Model 数据模型的版本属性:给Data Model(也就是被管理对象模型)添加一个新的版本:在项目导航栏中,选择Data Model 文件;

选择 Editor > Create Model Version 菜单项;

在对话框中,输入Data Model文件的名称,并点击Save按钮;


然后设置 Data Model的当前版本号:在项目导航栏中,选择Data Model文件;

在File inspector 面板窗口,找到Versioned Core Data Model 节点;

从弹出菜单中,选择当前模板版本号;

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Core Data