Inserts a menu item into the menu at a specific location.
- macOS 10.0+
An object conforming to the
NSMenuprotocol that represents a menu item.
An integer index identifying the location of the menu item in the menu.
This method posts an
NSMenu, allowing interested observers to update as appropriate. This method is a primitive method. All item-addition methods end up calling this method, so this is where you should implement custom behavior on adding new items to a menu in a custom subclass. If the menu item already exists in another menu, it is not inserted and the method raises an exception of type