---
title: NSComboBox
framework: appkit
role: symbol
role_heading: Class
path: appkit/nscombobox
---

# NSComboBox

A view that displays a list of values in a pop-up menu where the user selects a value or types in a custom value.

## Declaration

```swift
class NSComboBox
```

## Overview

Overview A combo box combines the behavior of an NSTextField object with an NSPopUpButton object. A combo box displays a list of values from a pop-up list, but also provides a means for users to type in custom values. For example, here’s a combo box in its initial state.

Clicking in the text portion of the control allows the user to edit the current value. When the user clicks the down arrow at the right side of the text field, the pop-up list appears.

The NSComboBox class uses NSComboBoxCell to implement its user interface. Also see the NSComboBoxDataSource protocol, which declares the methods that NSComboBox uses to access the contents of its data source object.

## Topics

### Setting Display Attributes

- [hasVerticalScroller](appkit/nscombobox/hasverticalscroller.md)
- [intercellSpacing](appkit/nscombobox/intercellspacing.md)
- [isButtonBordered](appkit/nscombobox/isbuttonbordered.md)
- [itemHeight](appkit/nscombobox/itemheight.md)
- [numberOfVisibleItems](appkit/nscombobox/numberofvisibleitems.md)

### Setting a Data Source

- [dataSource](appkit/nscombobox/datasource.md)
- [usesDataSource](appkit/nscombobox/usesdatasource.md)

### Configuring the Combo Box Items

- [addItems(withObjectValues:)](appkit/nscombobox/additems(withobjectvalues:).md)
- [addItem(withObjectValue:)](appkit/nscombobox/additem(withobjectvalue:).md)
- [insertItem(withObjectValue:at:)](appkit/nscombobox/insertitem(withobjectvalue:at:).md)
- [objectValues](appkit/nscombobox/objectvalues.md)
- [removeAllItems()](appkit/nscombobox/removeallitems().md)
- [removeItem(at:)](appkit/nscombobox/removeitem(at:).md)
- [removeItem(withObjectValue:)](appkit/nscombobox/removeitem(withobjectvalue:).md)
- [numberOfItems](appkit/nscombobox/numberofitems.md)

### Manipulating the Displayed List

- [indexOfItem(withObjectValue:)](appkit/nscombobox/indexofitem(withobjectvalue:).md)
- [itemObjectValue(at:)](appkit/nscombobox/itemobjectvalue(at:).md)
- [noteNumberOfItemsChanged()](appkit/nscombobox/notenumberofitemschanged().md)
- [reloadData()](appkit/nscombobox/reloaddata().md)
- [scrollItemAtIndexToTop(_:)](appkit/nscombobox/scrollitematindextotop(_:).md)
- [scrollItemAtIndexToVisible(_:)](appkit/nscombobox/scrollitematindextovisible(_:).md)

### Manipulating the Selection

- [deselectItem(at:)](appkit/nscombobox/deselectitem(at:).md)
- [indexOfSelectedItem](appkit/nscombobox/indexofselecteditem.md)
- [objectValueOfSelectedItem](appkit/nscombobox/objectvalueofselecteditem.md)
- [selectItem(at:)](appkit/nscombobox/selectitem(at:).md)
- [selectItem(withObjectValue:)](appkit/nscombobox/selectitem(withobjectvalue:).md)

### Completing the Text Field

- [completes](appkit/nscombobox/completes.md)

### Accessing the Delegate

- [delegate](appkit/nscombobox/delegate.md)

### Notifications

- [selectionDidChangeNotification](appkit/nscombobox/selectiondidchangenotification.md)
- [selectionIsChangingNotification](appkit/nscombobox/selectionischangingnotification.md)
- [willDismissNotification](appkit/nscombobox/willdismissnotification.md)
- [willPopUpNotification](appkit/nscombobox/willpopupnotification.md)

### Structures

- [NSComboBox.SelectionDidChangeMessage](appkit/nscombobox/selectiondidchangemessage.md)
- [NSComboBox.SelectionIsChangingMessage](appkit/nscombobox/selectionischangingmessage.md)
- [NSComboBox.WillDismissMessage](appkit/nscombobox/willdismissmessage.md)
- [NSComboBox.WillPopUpMessage](appkit/nscombobox/willpopupmessage.md)

## Relationships

### Inherits From

- [NSTextField](appkit/nstextfield.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSAccessibilityElementProtocol](appkit/nsaccessibilityelementprotocol.md)
- [NSAccessibilityNavigableStaticText](appkit/nsaccessibilitynavigablestatictext.md)
- [NSAccessibilityProtocol](appkit/nsaccessibilityprotocol.md)
- [NSAccessibilityStaticText](appkit/nsaccessibilitystatictext.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)
- [NSTextContent](appkit/nstextcontent.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [NSUserActivityRestoring](appkit/nsuseractivityrestoring.md)
- [NSUserInterfaceItemIdentification](appkit/nsuserinterfaceitemidentification.md)
- [NSUserInterfaceValidations](appkit/nsuserinterfacevalidations.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
