Core Data 'File “Contents” couldn't be opened'

99封情书 提交于 2020-01-15 04:15:40

问题


I made the silly mistake and I accidentially touch my current Core Data model instead the new version one I just created. So I went to source control and reverted the changes inside the **.xcdatamodeld group. However I have now a zombie entry in the project structure inside this group (its the new version **.xcdatamodel I have created) that I can't open (message like in the title). Probably because reverting deleting the files but somehow the reference is still there.

Just a little bit annoying. Tried cleaning, closing & reopening.


回答1:


I had two files with the same name, but only one showed in Xcode. This fixed it:

  1. Locate the NASModel.xcdatamodeld file in your project
  2. Right click and select 'Show Package Contents'
  3. Locate the two files with the same name
  4. Delete the one that is Zero bytes in size
  5. Rebuild and smile


来源:https://stackoverflow.com/questions/25847537/core-data-file-contents-couldnt-be-opened

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!