---
title: "tableView(_:setObjectValue:for:row:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstableviewdatasource/tableview(_:setobjectvalue:for:row:)"
---

# tableView(_:setObjectValue:for:row:)

Sets the data object for an item in the specified row and column.

## Declaration

```swift
@MainActor optional func tableView(_ tableView: NSTableView, setObjectValue object: Any?, for tableColumn: NSTableColumn?, row: Int)
```

## Parameters

- `tableView`: The table view that sent the message.
- `object`: The new value for the item.
- `tableColumn`: A column in aTableView.
- `row`: The row of the item in aTableColumn.

## Discussion

Discussion This method is intended for use with cell-based table views, it must not be used with view-based table views. In view-based tables, use target/action to set each item in the view cell. note: This method is optional if your application is using Cocoa bindings for providing data to the table view, otherwise it must be implemented.
