<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSOutlineViewDataSource/outlineView(_:setObjectValue:for:byItem:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSOutlineViewDataSource(im)outlineView:setObjectValue:forTableColumn:byItem:"
  },
  "title" : "outlineView(_:setObjectValue:for:byItem:)"
}
-->

# outlineView(_:setObjectValue:for:byItem:)

Set the data object for a given item in a given column.

```
@MainActor optional func outlineView(_ outlineView: NSOutlineView, setObjectValue object: Any?, for tableColumn: NSTableColumn?, byItem item: Any?)
```

## Parameters

`outlineView`

The outline view that sent the message.

`object`

The new value for the item.

`tableColumn`

A column in `outlineView`.

`item`

An item in the data source in the specified `tableColumn` of the view.

## Discussion

The item is located in the specified `tableColumn` of the view.

> 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 outline view using Cocoa bindings.**
> 
> Do not call ``doc://com.apple.appkit/documentation/AppKit/NSTableView/reloadData()`` from this method.

---

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)