Instance Method

indexOfItem:

Returns the index of the specified menu item.

Declaration

- (NSInteger)indexOfItem:(NSMenuItem *)item;

Parameters

anObject

The menu item whose index you want.

Return Value

The index of the item or -1 if no such item was found.

Discussion

This method invokes the method of the same name of its NSPopUpButtonCell object.

See Also

Getting the indices of menu items

- indexOfItemWithTag:

Returns the index of the menu item with the specified tag.

- indexOfItemWithTitle:

Returns the index of the item with the specified title.

- indexOfItemWithRepresentedObject:

Returns the index of the menu item that holds the specified represented object.

- indexOfItemWithTarget:andAction:

Returns the index of the menu item with the specified target and action.