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
class NSComboBoxOverview
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.
[Image]
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.
[Image]
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
Setting a Data Source
Configuring the Combo Box Items
addItems(withObjectValues:)addItem(withObjectValue:)insertItem(withObjectValue:at:)objectValuesremoveAllItems()removeItem(at:)removeItem(withObjectValue:)numberOfItems
Manipulating the Displayed List
indexOfItem(withObjectValue:)itemObjectValue(at:)noteNumberOfItemsChanged()reloadData()scrollItemAtIndexToTop(_:)scrollItemAtIndexToVisible(_:)
Manipulating the Selection
deselectItem(at:)indexOfSelectedItemobjectValueOfSelectedItemselectItem(at:)selectItem(withObjectValue:)