Search code examples
xcodecore-dataxcode4.2versioningdatamodel

Xcode menu item Editor / Add Model Version... missing


Every once in a while I try to add a new data model version, and the menu item is missing. It seems the Editor menu is supposed to change depending on the file selected, and this sometimes doesn't happen. It the past I've randomly clicked, cleaned, built, etc. and eventually it showed up again with me not knowing what happened. Today it seems restarting Xcode fixed it, but I don't know if that will always work. Below are two screen shots, the first showing the wrong menu, and the second showing the correct menu. My data model is selected in both cases. Has anyone else seen this? Is it a bug, or is there some setting or selection I'm missing? enter image description here enter image description here


Solution

  • From the color of that file navigator bar I can see that you did not select the datamodel file. You probably were in "Assistant Editor"-Mode and had a .h or .m file on the right side. The active cursor was in the right file too.

    The selected file shows a darker shade of gray:

    enter image description here

    The not selected file uses a lighter shade of gray:

    enter image description here

    It's important to know that the file selection highlight in the left side bar does not change when you select a different file without using the side bar. Don't trust the sidebar when you are editing files.

    Click into the data model file first and your menu will be like you expect it.