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

# dataSource

The object that provides the item data for the combo box.

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

## Discussion

Assigning an object to this property does not automatically set the [`usesDataSource`](/documentation/AppKit/NSComboBox/usesDataSource) property to <doc://com.apple.documentation/documentation/Swift/true>. If the  [`usesDataSource`](/documentation/AppKit/NSComboBox/usesDataSource) property is <doc://com.apple.documentation/documentation/Swift/false>, accessing this property logs a warning. The default value of this property is `nil`.

For information about how to implement a combo box data source, see `NSComboBoxDataSource`.

---

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)