---
title: "comboBoxCell(_:objectValueForItemAt:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscomboboxcelldatasource/comboboxcell(_:objectvalueforitemat:)"
---

# comboBoxCell(_:objectValueForItemAt:)

Returns the object that corresponds to the item at the given index in the combo box cell.

## Declaration

```swift
optional func comboBoxCell(_ comboBoxCell: NSComboBoxCell, objectValueForItemAt index: Int) -> Any
```

## Parameters

- `comboBoxCell`: The combo box cell for which to return the item.
- `index`: The index of the item to return.

## Return Value

Return Value The object corresponding to the item at the specified index in the given combo box cell.

## Discussion

Discussion An NSComboBoxCell object uses this method to populate the items displayed in its pop-up list. important: While this method is marked as @optional in the protocol, you must implement this method if you are not providing the data for the combo box using using Cocoa bindings.

## See Also

### Related Documentation

- [NSComboBoxCellDataSource](appkit/nscomboboxcelldatasource.md)

### Instance Methods

- [comboBoxCell(_:completedString:)](appkit/nscomboboxcelldatasource/comboboxcell(_:completedstring:).md)
- [comboBoxCell(_:indexOfItemWithStringValue:)](appkit/nscomboboxcelldatasource/comboboxcell(_:indexofitemwithstringvalue:).md)
- [numberOfItems(in:)](appkit/nscomboboxcelldatasource/numberofitems(in:).md)
