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

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

Asks the delegate whether the specified cell should be tracked.

```
@MainActor optional func tableView(_ tableView: NSTableView, shouldTrackCell cell: NSCell, for tableColumn: NSTableColumn?, row: Int) -> Bool
```

## Parameters

`tableView`

The table view that sent the message.

`cell`

The cell to track.

`tableColumn`

The table column.

`row`

A row in `tableView`.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the cell should be tracked, <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion

In general, only selectable or selected cells can be tracked. If you implement this method, cells that aren’t selectable or selected can be tracked; similarly, cells that are selectable or selected can be set as untracked.

For example, this allows you to have an [`NSButtonCell`](/documentation/AppKit/NSButtonCell) object in a table that doesn’t change the selection, but can still be clicked on and tracked.

> Note:
> This method is only valid for ``doc://com.apple.appkit/documentation/AppKit/NSCell``-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)