英文:
Preferences menu item appears as "Settings"
问题
在我的 macOS 应用程序的故事板中,我包含了一个名为 "Preferences…" 的菜单项,它出现在我的应用程序菜单中,位于第三个菜单项(第一项是 "Amount",第二项是分隔符,第三项是 "Preferences…",第四项是另一个分隔符)。选择此菜单项会打开我的首选项屏幕。然而,当我运行我的应用程序时,这个菜单项总是显示为 "Settings…",我不确定为什么或如何使其显示故事板中定义的内容。
是否有人可以解释为什么会发生这种情况,或者指引我查找可能提供解释和纠正操作的文档?
谢谢!
英文:
In the storyboard for my macOS application, I've included a "Preferences…" menu item that appears as the third menu item in my application menu (first item is my Amount, second is a separator, third is "Preferences…", fourth is another separator). Choosing this menu item brings up my preferences screen. However, when I run my application, this menu item always say "Settings…" and I'm not sure why or how to make it show what's defined in the storyboard.
Can someone explain why this is happening, or point me to the document that may provide an explanation and corrective actions?
Thanks!
答案1
得分: 2
显然,对于文图拉来说,这是一项新的变化,因为随着系统设置的彻底改版,现在所有的应用程序都在运行时使用“设置”而不是“首选项”,当在 13.x 以下的版本下运行应用程序时,故事板中分配的标题仍然会显示出来。
无论如何,在文图拉下有一种方法可以更改菜单项,但应该允许操作系统自动管理这个菜单项,以遵守正确的人机界面准则。这里提供的解决方案仅供参考:
你可以在应用程序的 applicationWillFinishLaunching 方法中保存故事板菜单项标题(首选项),然后在 applicationDidFinishLaunching 中重新设置标题。
英文:
Apparently, this is something new to Ventura, as it reflects a change with the overhaul of System Settings with all apps now using "Settings" as opposed to "Preferences" when running under 13.x. When the app runs under earlier versions of the OS, the title assigned in the storyboard will still show up.
In any case, there is a way to change the menu item under Ventura, with the caveat that you should just allow the OS to manage this menu item for you in order to abide by proper human interface guidelines. The solution here is given just for completeness:
You can save the title (Preferences) assigned in your storyboard menu item title in the application's applicationWillFinishLaunching method, then reset the title in applicationDidFinishLaunching.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论