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

原文  http://www.entlib.net/?p=2516ide

在iOS 6 – Core Data 应用程序的开发过程当中, App启动时出现以下异常信息:ui

reason = “The model used to open the store is incompatible with the one used to create the store”spa

出现上述异常的缘由是 :咱们修改了Data Model文件,增长了新的Entity,包括Attribute属性、Relationship关系等等。.net

解决办法:orm

(1) 最简单的办法是,在iOS 5 或者 6的模拟器中,删除App,而后从新运行就能够了。对象

(2) 第二种办法是使用Data Model 数据模型的版本属性:blog

给Data Model(也就是被管理对象模型)添加一个新的版本:ip

  1. 在项目导航栏中,选择Data Model 文件;开发

  2. 选择 Editor > Create Model Version 菜单项;get

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

而后设置 Data Model的当前版本号:

  1. 在项目导航栏中,选择Data Model文件;

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

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

相关文章
相关标签/搜索