Getting NSMenuItem of NSMenu tree by title
问题 I have an NSMenu (let's say the Main Menu), with lots of NSMenu s in it, and NSMenuItem s at different levels. I want to be able to get the NSMenuItem instance specifying the tree path (with the title of the corresponding NSMenus/NSMenuItems in it). Example : Menu : File New Open Document Project Save Save As... Path : /File/Open/Document How would you go about it, in the most efficient and Cocoa-friendly way? 回答1: I think that best way would be to obtain the NSMenuItem by specifying its