问题 NSStatusItem.popUpMenu has been deprecated in macOS 10.14, but I can't find a nice alternative. let m = statusItem.menu! statusItem.popUpMenu(m) // deprecated I tried direct pop-up using menu and the button, but it doesn't position properly. let m1 = m.items.first! m.popUp(positioning: m1, at: .zero, in: statusItem.button!) 回答1: Xcode suggests to use menu property instead of popupMenu . But once you set the menu property, every click on the item will only show the menu. Instead, if you want