Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 8 can't open Model.xcdatamodeld

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

like image 288
Sajjon Avatar asked Feb 07 '23 02:02

Sajjon


1 Answers

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! :)

like image 131
Sajjon Avatar answered Feb 13 '23 05:02

Sajjon