4

I am running macOS Sierra (Build 16A320), using Xcode 8.0 (8A218a) and have migrated all my code to Swift 3.

I can't open my Model.xcdatamodeld file anymore. Selecting it in the project navigator does not open up the "Core Data Model editor" view (not sure what it is called). I have tried restarting Xcode, but it does not work. I have tried deleting derived data, cleaning, does not work. I have tried double clicking, does not work.

Model.xcdatamodeld is visible in the Project navigator view, but it is not possible to interact with it (other than right clicking), nothing happens when I click or double click on it.

EDIT: Problem solved, see my answer below

Community
  • 1
  • 1
Sajjon
  • 8,938
  • 5
  • 60
  • 94
  • What does happen when you click on it? – Tom Harrington Sep 21 '16 at 21:35
  • Neither clicking, nor double clicking helped... But I solved it, check my answer :) – Sajjon Sep 21 '16 at 21:36
  • Glad you solved it, but for people searching in the future it might help if you described *what actually happened* when you clicked on it, instead of just saying that the editor didn't open. What did you actually see in Xcode when you tried? – Tom Harrington Sep 21 '16 at 21:38
  • Nothing... the `Model.xcdatamodeld` file was visible in the project navigator, but was not clickable. I will update the question to make this more clear – Sajjon Sep 21 '16 at 21:40

1 Answers1

8

Okay so I solved it... Hmm not sure why but seems like some part of the Swift Migration guide messed up the Model.

SOLUTION:

  1. Remove the model from the project (was not even asked about trash or reference, but delete reference if asked of course).
  2. Re-add the file

This resulted in this Git change (screenshot from SourceTree):

enter image description here

As you can see, the Model.xcdatamodel (note difference vs Model.xcdatamodeld) file was missing! I guess it somehow got messed up during the -> Swift 3 migration?

Anyway, now it works! :)

Sajjon
  • 8,938
  • 5
  • 60
  • 94