I have a list of user-configurable things that show in a main menu submenu. The first 9 items get the shortcuts ⌘1--⌘9 assigned:
let item = theMenu.addItem(
withTitle: title,
action: #selector(itemSelected(_:)),
keyEquivalent: "1")
item.target = self
item.keyEquivalentModifierMask = [.command]
The shortcut ⌘1 doesn't work until you open the menu once. After that, it works as expected. This setup code is called on launch, by the way.
Could this be an issue of menu item validation? Or is this approach just inferior to a menu with a delegate?