<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPopUpButtonCell/selectItem(withTitle:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPopUpButtonCell(im)selectItemWithTitle:"
  },
  "title" : "selectItem(withTitle:)"
}
-->

# selectItem(withTitle:)

Selects the item with the specified title.

```
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

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`](/documentation/AppKit/NSPopUpButtonCell/altersStateOfSelectedItem) property to <doc://com.apple.documentation/documentation/Swift/false>.

## See Also

[`altersStateOfSelectedItem`](/documentation/AppKit/NSPopUpButtonCell/altersStateOfSelectedItem)

A Boolean value that indicates if the pop-up button links the state of the selected menu item to the current selection.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)