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

# select(_:)

Selects the specified menu item.

```
func select(_ item: NSMenuItem?)
```

## 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`](/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)