<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSComboBoxCell/dataSource",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSComboBoxCell(py)dataSource"
  },
  "title" : "dataSource"
}
-->

# dataSource

The object that provides the data displayed in the combo box’s pop-up list.

```
unowned(unsafe) var dataSource: (any NSComboBoxCellDataSource)? { get set }
```

## Discussion

The value of this property should be an object that implements the appropriate methods of the NSComboBoxCellDataSource informal protocol. Note that setting this property doesn’t automatically set [`usesDataSource`](/documentation/AppKit/NSComboBoxCell/usesDataSource) to <doc://com.apple.documentation/documentation/Swift/false> and in fact logs a warning if [`usesDataSource`](/documentation/AppKit/NSComboBoxCell/usesDataSource) is <doc://com.apple.documentation/documentation/Swift/false>. If you set this property to an object that doesn’t respond to either numberOfItemsInComboBoxCell: or comboBoxCell:objectValueForItemAtIndex:, a warning is logged if [`usesDataSource`](/documentation/AppKit/NSComboBoxCell/usesDataSource) is <doc://com.apple.documentation/documentation/Swift/false>. See the class description and the NSComboBoxCellDataSource informal protocol specification for more information on combo box cell data source objects.

---

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)