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

# selectItem(at:)

Selects the item in the menu at the specified index.

```
func selectItem(at index: Int)
```

## Parameters

`index`

The index of the item you want to select, or `-1` you want to deselect all menu items.

## See Also

[`indexOfSelectedItem`](/documentation/AppKit/NSPopUpButton/indexOfSelectedItem)

The index of the item that was last selected by the user.



---

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)