zoukankan      html  css  js  c++  java
  • CoreData修改了数据模型报错 The model used to open the store is incompatible with the one used to create the store

    在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(也就是被管理对象模型)添加一个新的版本:

    1. 在项目导航栏中,选择Data Model 文件;
    2. 选择 Editor > Create Model Version 菜单项;
    3. 在对话框中,输入Data Model文件的名称,并点击Save按钮;

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

    1. 在项目导航栏中,选择Data Model文件;
    2. 在File inspector 面板窗口,找到Versioned Core Data Model 节点;
    3. 从弹出菜单中,选择当前模板版本号;

  • 相关阅读:
    php配置GD库
    Linux 安装 Apache2+php5+gd+freetype2
    gd库
    数组和链表的区别
    python 整数中1出现的次数
    python栈--字符串反转,括号匹配
    Linux基础知识
    操作系统
    后台面试问题
    python 面向对象
  • 原文地址:https://www.cnblogs.com/endtel/p/5368983.html
Copyright © 2011-2022 走看看