lshboo 发表于 2019-1-27 14:12:01

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

  原文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按钮;
http://img1.tuicool.com/ZvMneu.png
  然后设置 Data Model的当前版本号:

[*]  在项目导航栏中,选择Data Model文件;
[*]  在File inspector 面板窗口,找到Versioned Core Data Model 节点;
[*]  从弹出菜单中,选择当前模板版本号;
http://img0.tuicool.com/7BzUZn.png

页: [1]
查看完整版本: The model used to open the store is incompatible with the one used to create the