0

I've added new model version before in this project but for some reason I cannot add them now. When I right click on ****.xcdatamodeld and select "Add model version" from Editor menu. New version is showing up in Finder when I click "Show in Finder" but not under ****.xcdatamodeld nor in File Inspector??? I cannot add them manually under ****.xcdatamodeld as well.

I've added Apple Watch support in my project recently, in case if this information helps.

Santo
  • 1,611
  • 3
  • 17
  • 37
Matt
  • 1,711
  • 18
  • 20

3 Answers3

0

To be honest, I don't think I found a satisfactory answer but a few workarounds to what I think is a bug.

A solution here refers to incorrect directory structure, I did not give this a try as the xCode versions seem quite old but maybe it might help you: Issues with directory structure

This seems like a hack which worked for some, even in xCode 7.2

While none of these options worked for me, even quitting xCode, restarting Mac, I just had the beta 7.1 lying around, adding a new version worked perfectly and then I switched back to 7.3 to continue the rest.

Community
  • 1
  • 1
Shawn Frank
  • 4,381
  • 2
  • 19
  • 29
0

To be honest, I don't think I found a satisfactory answer but a it solved my problem.i created a new project, in that project I did my model versioning(in latest xcode) and copied that model object in to my project.It works well.

0

Having just experienced watching nothing happen after selecting Add Model Version, I quickly found (stumbled upon) a solution that works. Credit goes to Shawn's hack link, in which Mundi points to the xcdatamodels.

  1. Alt-select an xcdatamodel and then Show in Finder
  2. Quit Xcode
  3. In the Finder folder with all the versions, I found one version already existed (but wasn't showing in Xcode) with the version I had tried to make several times.
  4. Delete this imposter!
  5. Open Xcode and try Add Model Version
  6. The new version was added.
David
  • 3,285
  • 1
  • 37
  • 54