Xcode 菜单项编辑器/添加模型版本...丢失
每隔一段时间,我就会尝试添加新的数据模型版本,但菜单项丢失。编辑器菜单似乎应该根据所选文件而变化,但有时不会发生这种情况。过去我随机点击、清理、建造等等,最终它再次出现,我不知道发生了什么。今天重启 Xcode 似乎修复了这个问题,但我不知道这是否永远有效。下面是两个屏幕截图,第一个显示错误的菜单,第二个显示正确的菜单。在这两种情况下都选择了我的数据模型。还有其他人看过这个吗?这是一个错误,还是我缺少一些设置或选择?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从该文件导航栏的颜色我可以看到您没有选择数据模型文件。您可能处于“助理编辑器”模式,并且右侧有一个 .h 或 .m 文件。活动光标也位于正确的文件中。
选定的文件显示较深的灰色阴影:
未选定的文件使用较浅的灰色阴影:
< img src="https://i.sstatic.net/DXjBB.png" alt="在此处输入图像描述">
重要的是要知道,当您选择不同的文件时,左侧栏中的文件选择突出显示不会改变不使用侧边栏。编辑文件时不要相信侧边栏。
首先单击数据模型文件,您的菜单将如您所期望的那样。
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:
The not selected file uses a lighter shade of gray:
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.
除非你在选择文件后超级快地选择菜单(可能没有给 Xcode 时间来交换它),否则我会说提交错误报告 http://bugreporter.apple.com
您应该给 Xcode 一些时间来交换菜单,以确定它是什么类型的错误,如果它在 60 秒左右后没有交换出来,那么它可能不仅仅是一场表演 问题)。确保包含系统配置文件,因为我刚刚检查了我的系统配置文件,每次我切换到数据模型时,它都会相应地更改菜单。
xib 文件是否会发生同样的情况?您使用的任何其他文件类型有时具有不同的菜单?
Unless your are selecting the menu super fast after selecting the file (possibly not giving Xcode time to swap it out) then I say file a bug report http://bugreporter.apple.com
You should give Xcode a few moments to swap the menu out though to determine what kind of bug it is, if it doesn't swap out after 60 seconds or so then it likely isn't just a performance issue). Make sure to include a system profile as I just checked on my and every time I switched to a data model it changed the menu accordingly.
Does the same thing ever happen with xib files? Any other file types you use that sometimes have different menus?