问题
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:
- Locate the NASModel.xcdatamodeld file in your project
- Right click and select 'Show Package Contents'
- Locate the two files with the same name
- Delete the one that is Zero bytes in size
- Rebuild and smile
来源:https://stackoverflow.com/questions/25847537/core-data-file-contents-couldnt-be-opened