<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTableViewDelegate/tableView(_:rowViewForRow:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTableViewDelegate(im)tableView:rowViewForRow:"
  },
  "title" : "tableView(_:rowViewForRow:)"
}
-->

# tableView(_:rowViewForRow:)

Asks the delegate for a view to display the specified row.

```
@MainActor optional func tableView(_ tableView: NSTableView, rowViewForRow row: Int) -> NSTableRowView?
```

## Parameters

`tableView`

The table view that sent the message.

`row`

The row index.

## Return Value

An instance or subclass of [`NSTableRowView`](/documentation/AppKit/NSTableRowView). If `nil` is returned, an [`NSTableRowView`](/documentation/AppKit/NSTableRowView) instance will be created and used.

## Discussion

The delegate can implement this method to return a custom [`NSTableRowView`](/documentation/AppKit/NSTableRowView) for `row`.

The reuse queue can be used in the same way as documented in [`tableView(_:viewFor:row:)`](/documentation/AppKit/NSTableViewDelegate/tableView(_:viewFor:row:)). The returned view will have attributes properly set to it before it’s added to the `tableView`.

> Note:
> This method is only valid for ``doc://com.apple.appkit/documentation/AppKit/NSView``-based table views.

---

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)