---
title: dataSource
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsoutlineview/datasource
---

# dataSource

The object that provides the data displayed by the receiver.

## Declaration

```swift
weak var dataSource: (any NSOutlineViewDataSource)? { get set }
```

## Discussion

Discussion The object must implement the appropriate methods of NSOutlineViewDataSource. Note that in versions of macOS prior to v10.12, the outline view did not retain the data source in a managed memory environment. Setting the data source invokes tile(). If the data source doesn’t respond to all of the outlineView(_:child:ofItem:), outlineView(_:isItemExpandable:), outlineView(_:numberOfChildrenOfItem:), and outlineView(_:objectValueFor:byItem:) methods, an internalInconsistencyException may be raised.

## See Also

### Related Documentation

- [Drag and Drop](appkit/drag-and-drop.md)
- [Outline View](appkit/outline-view.md)

### Accessing the Data Source

- [stronglyReferencesItems](appkit/nsoutlineview/stronglyreferencesitems.md)
