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. 從彈出菜單中,選擇當前模板版本號;

相關文章
相關標籤/搜索