patman
patman

Reputation: 2840

Core Data 'File "Contents" couldn't be opened'

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.

Upvotes: 2

Views: 872

Answers (1)

Otziii
Otziii

Reputation: 2496

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

  1. Locate the **.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

Upvotes: 1

Related Questions