indexOfItem(withTarget:andAction:)
Returns the index of the first menu item in the menu that has a specified action and target.
Declaration
func indexOfItem(withTarget target: Any?, andAction actionSelector: Selector?) -> IntParameters
- target:
An object that is set as the target of a menu item of the menu.
- actionSelector:
A selector identifying an action method. If
actionSelectorisNULL, the first menu item in the menu that has targetanObjectis returned.
Return Value
The integer index of the menu item or, if no such menu item is in the menu, –1.