After adding a CoreData Model to my existing project using
File > New > File... > Core Data > Data Model
I am unable to edit the model. The project now includes a .xcdatamodeld package reference, but clicking on it in Project Navigator has the same effect as clicking on a folder or group, the current editor does not change. Also right clicking the reference and selecting "Open As >" lists no potential editors. Furthermore, opening the file inspector panel only lists settings for "Identity" "Target Membership" and "Text Settings", it does not list settings for "Core Data Model" or "Versioned Core Data Model"
Not that this should have any effect on XCodes ability to recognize a file type, but I have also referenced CoreData.framework in build phases, and included the necessary Core Data properties in the AppDelegate.
What's strange is I have opened the .xcdatamodeld package in Finder to expose the internal .xcdatamodel (note no trailing 'd'). Double clicking that file will open XCode with the Core Data Model Editor as expected.
Even stranger still is, I created a new projected and clicked the "Use Core Data" check box. Doing so allowed me edit the data model by selecting the .xcdatamodeld reference in the Project Navigator. Hence my machine and XCode are capable and configured to edit CoreData files.
It's as if XCode is unable to use Core Data unless the original project was created with the "Use Core Data" check box.
Has anyone experienced this issue, were you able to fix it, and how?
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…