<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPopUpButton/selectItem(withTitle:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPopUpButton(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.

## See Also

[`-  indexOfItemWithTitle:`](/documentation/AppKit/NSPopUpButton/indexOfItem(withTitle:))

Returns the index of the item with the specified title.

[`-  addItemWithTitle:`](/documentation/AppKit/NSPopUpButton/addItem(withTitle:))

Adds an item with the specified title to the end of the menu.

[`-  setTitle:`](/documentation/AppKit/NSPopUpButton/setTitle(_:))

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



---

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)