如何刪除舊的data model version

這是一個小技巧:

  1. 設置好當前要使用的版本;
  2. 在XCode中刪除.xcdatamodeld的引用 (Right-click -> Delete -> Remove Reference Only);
  3. 在Finder中顯示.xcdatamodeld包內容 (Right-click -> Show Package Contents);
  4. 刪除不想要的.xcdatamodel舊版本文件;
  5. 重新將.xcdatamodeld添加到項目中。

It's a hack, but this worked for me:

  1. Set the Current version of the model in Xcode to one that you want to keep
  2. Remove the .xcdatamodeld from your project (Right-click -> Delete -> Remove Reference Only)
  3. Show the contents of the .xcdatamodeld package in the Finder (Right-click -> Show Package Contents)
  4. Delete the .xcdatamodel file(s) that you don't want anymore
  5. Re-add the .xcdatamodeld file to your project
原文地址
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章