這是一個小技巧:
- 設置好當前要使用的版本;
- 在XCode中刪除.xcdatamodeld的引用 (Right-click -> Delete -> Remove Reference Only);
- 在Finder中顯示.xcdatamodeld包內容 (Right-click -> Show Package Contents);
- 刪除不想要的.xcdatamodel舊版本文件;
- 重新將.xcdatamodeld添加到項目中。
It's a hack, but this worked for me:
- Set the Current version of the model in Xcode to one that you want to keep
- Remove the .xcdatamodeld from your project (Right-click -> Delete -> Remove Reference Only)
- Show the contents of the .xcdatamodeld package in the Finder (Right-click -> Show Package Contents)
- Delete the .xcdatamodel file(s) that you don't want anymore
- Re-add the .xcdatamodeld file to your project