Matt
Matt

Reputation: 1761

Cannot add model version xcode 7.3

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.

Upvotes: 1

Views: 687

Answers (3)

David
David

Reputation: 3323

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.

Upvotes: 0

naresh cherukuri
naresh cherukuri

Reputation: 1

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.

Upvotes: 0

Shawn Frank
Shawn Frank

Reputation: 5143

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.

Upvotes: 0

Related Questions