Instance Method

selectItem:

Selects the specified menu item.

Declaration

- (void)selectItem:(NSMenuItem *)item;

Parameters

item

The menu item to select, or nil if you want to deselect all menu items.

Discussion

By default, selecting or deselecting a menu item from a pop-up menu changes its state. Selecting a menu item from a pull-down menu does not automatically alter the state of the item. To disassociate the current selection from the state of menu items, set the altersStateOfSelectedItem property to NO.

See Also

Dealing with selection

- selectItemAtIndex:

Selects the item in the menu at the specified index.

- selectItemWithTag:

Selects the menu item with the specified tag.

- selectItemWithTitle:

Selects the item with the specified title.

- setTitle:

Sets the string displayed in the receiver when the user isn’t pressing the mouse button.

selectedItem

The menu item last selected by the user.

indexOfSelectedItem

The index of the item last selected by the user.

- synchronizeTitleAndSelectedItem

Synchronizes the pop-up button’s displayed item with the currently selected menu item.