Can't open Data Model File in Xcode

1.3k Views Asked by At

Using MacOS Sierra(10.12.1 (16B2555)) and Xcode 8.1(8B62). Created a new Project without selecting "Use Core Data". Now when I create a new Data Model, I can't open it in Xcode editor.

screenshot

Even if I right click, Open As-> doesn't show any option.

I had a look at this question, but the answer doesn't help me.

I have deleted and re-added file, even re-generated the data model. I have cleaned project and build folder. Also committed to source control and then retried. Even restarted Xcode and Mac, but nothing seems to be working.

How can I use Core Data in my project now?

2

There are 2 best solutions below

0
Bretsko On

You could try open the package contents of xcdatamodeld, drag out the file inside with the same name and use it instead. I had the same problem and thanks to this answer solved it.

0
Takunda Geraldino Chibanda On

I created the same file in a different folder to test if it will work and it did. I deleted it and tried to re create it in the folder i wanted then it worked