---
title: NSPopUpButton
framework: appkit
role: symbol
role_heading: Class
path: appkit/nspopupbutton
---

# NSPopUpButton

A control for selecting an item from a list.

## Declaration

```swift
class NSPopUpButton
```

## Overview

Overview An NSPopUpButton object uses an NSPopUpButtonCell object to implement its user interface. Note that while a menu is tracking user input, programmatic changes to the menu, such as adding, removing, or changing items on the menu, is not reflected. important: Setting a pop up button’s image property has no effect. The image displayed in a pop up button is taken from the selected menu item (in the case of a pop up menu) or from the first menu item (in the case of a pull-down menu).

## Topics

### Initializing an NSPopUpButton

- [init(frame:pullsDown:)](appkit/nspopupbutton/init(frame:pullsdown:).md)

### Configuring the Cell

- [NSPopUpButtonCell](appkit/nspopupbuttoncell.md)

### Setting the type of menu

- [pullsDown](appkit/nspopupbutton/pullsdown.md)
- [autoenablesItems](appkit/nspopupbutton/autoenablesitems.md)

### Inserting and deleting items

- [addItem(withTitle:)](appkit/nspopupbutton/additem(withtitle:).md)
- [addItems(withTitles:)](appkit/nspopupbutton/additems(withtitles:).md)
- [insertItem(withTitle:at:)](appkit/nspopupbutton/insertitem(withtitle:at:).md)
- [removeAllItems()](appkit/nspopupbutton/removeallitems().md)
- [removeItem(withTitle:)](appkit/nspopupbutton/removeitem(withtitle:).md)
- [removeItem(at:)](appkit/nspopupbutton/removeitem(at:).md)

### Getting the user’s selection

- [selectedItem](appkit/nspopupbutton/selecteditem.md)
- [titleOfSelectedItem](appkit/nspopupbutton/titleofselecteditem.md)
- [indexOfSelectedItem](appkit/nspopupbutton/indexofselecteditem.md)

### Setting the current selection

- [select(_:)](appkit/nspopupbutton/select(_:).md)
- [selectItem(at:)](appkit/nspopupbutton/selectitem(at:).md)
- [selectItem(withTag:)](appkit/nspopupbutton/selectitem(withtag:).md)
- [selectItem(withTitle:)](appkit/nspopupbutton/selectitem(withtitle:).md)

### Getting menu items

- [menu](appkit/nspopupbutton/menu.md)
- [numberOfItems](appkit/nspopupbutton/numberofitems.md)
- [itemArray](appkit/nspopupbutton/itemarray.md)
- [item(at:)](appkit/nspopupbutton/item(at:).md)
- [itemTitle(at:)](appkit/nspopupbutton/itemtitle(at:).md)
- [itemTitles](appkit/nspopupbutton/itemtitles.md)
- [item(withTitle:)](appkit/nspopupbutton/item(withtitle:).md)
- [lastItem](appkit/nspopupbutton/lastitem.md)

### Getting the indices of menu items

- [index(of:)](appkit/nspopupbutton/index(of:).md)
- [indexOfItem(withTag:)](appkit/nspopupbutton/indexofitem(withtag:).md)
- [indexOfItem(withTitle:)](appkit/nspopupbutton/indexofitem(withtitle:).md)
- [indexOfItem(withRepresentedObject:)](appkit/nspopupbutton/indexofitem(withrepresentedobject:).md)
- [indexOfItem(withTarget:andAction:)](appkit/nspopupbutton/indexofitem(withtarget:andaction:).md)

### Setting the cell edge to pop out in restricted situations

- [preferredEdge](appkit/nspopupbutton/preferrededge.md)

### Setting the title

- [setTitle(_:)](appkit/nspopupbutton/settitle(_:).md)

### Setting the state

- [synchronizeTitleAndSelectedItem()](appkit/nspopupbutton/synchronizetitleandselecteditem().md)

### Notifications

- [willPopUpNotification](appkit/nspopupbutton/willpopupnotification.md)

### Instance Methods

- [selectedTag()](appkit/nspopupbutton/selectedtag().md)

### Structures

- [NSPopUpButton.WillPopUpMessage](appkit/nspopupbutton/willpopupmessage.md)

### Initializers

- [init(image:pullDownMenu:)](appkit/nspopupbutton/init(image:pulldownmenu:).md)
- [init(popUpMenu:target:action:)](appkit/nspopupbutton/init(popupmenu:target:action:).md)
- [init(title:image:pullDownMenu:)](appkit/nspopupbutton/init(title:image:pulldownmenu:).md)

### Instance Properties

- [altersStateOfSelectedItem](appkit/nspopupbutton/altersstateofselecteditem.md)
- [usesItemFromMenu](appkit/nspopupbutton/usesitemfrommenu.md)

## Relationships

### Inherits From

- [NSButton](appkit/nsbutton.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSAccessibilityButton](appkit/nsaccessibilitybutton.md)
- [NSAccessibilityElementProtocol](appkit/nsaccessibilityelementprotocol.md)
- [NSAccessibilityProtocol](appkit/nsaccessibilityprotocol.md)
- [NSAnimatablePropertyContainer](appkit/nsanimatablepropertycontainer.md)
- [NSAppearanceCustomization](appkit/nsappearancecustomization.md)
- [NSCoding](foundation/nscoding.md)
- [NSDraggingDestination](appkit/nsdraggingdestination.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSStandardKeyBindingResponding](appkit/nsstandardkeybindingresponding.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [NSUserActivityRestoring](appkit/nsuseractivityrestoring.md)
- [NSUserInterfaceCompression](appkit/nsuserinterfacecompression.md)
- [NSUserInterfaceItemIdentification](appkit/nsuserinterfaceitemidentification.md)
- [NSUserInterfaceValidations](appkit/nsuserinterfacevalidations.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Controls

- [Responding to control-based events using target-action](uikit/responding-to-control-based-events-using-target-action.md)
- [NSButton](appkit/nsbutton.md)
- [NSColorWell](appkit/nscolorwell.md)
- [Combo Box](appkit/combo-box.md)
- [NSComboButton](appkit/nscombobutton.md)
- [Date Picker](appkit/date-picker.md)
- [NSImageView](appkit/nsimageview.md)
- [NSLevelIndicator](appkit/nslevelindicator.md)
- [Path Control](appkit/path-control.md)
- [NSProgressIndicator](appkit/nsprogressindicator.md)
- [NSRuleEditor](appkit/nsruleeditor.md)
- [NSPredicateEditor](appkit/nspredicateeditor.md)
- [Search Field](appkit/search-field.md)
- [NSSegmentedControl](appkit/nssegmentedcontrol.md)
- [Slider](appkit/slider.md)
