---
title: "selectItem(withTitle:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nspopupbuttoncell/selectitem(withtitle:)"
---

# selectItem(withTitle:)

Selects the item with the specified title.

## Declaration

```swift
func selectItem(withTitle title: String)
```

## Parameters

- `title`: The title of the item to select. If you specify an empty string, or a string that does not match the title of a menu item, this method deselects the currently selected item.

## Discussion

Discussion By default, selecting or deselecting a menu item changes its state. To disassociate the current selection from the state of menu items, set the altersStateOfSelectedItem property to false.

## See Also

### Related Documentation

- [altersStateOfSelectedItem](appkit/nspopupbuttoncell/altersstateofselecteditem.md)

### Dealing with selection

- [select(_:)](appkit/nspopupbuttoncell/select(_:).md)
- [selectItem(at:)](appkit/nspopupbuttoncell/selectitem(at:).md)
- [selectItem(withTag:)](appkit/nspopupbuttoncell/selectitem(withtag:).md)
- [setTitle(_:)](appkit/nspopupbuttoncell/settitle(_:).md)
- [selectedItem](appkit/nspopupbuttoncell/selecteditem.md)
- [indexOfSelectedItem](appkit/nspopupbuttoncell/indexofselecteditem.md)
- [synchronizeTitleAndSelectedItem()](appkit/nspopupbuttoncell/synchronizetitleandselecteditem().md)
