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

# tableView(_:toolTipFor:rect:tableColumn:row:mouseLocation:)

Asks the delegate for a string to display in a tooltip for the specified cell in the column and row.

```
@MainActor optional func tableView(_ tableView: NSTableView, toolTipFor cell: NSCell, rect: NSRectPointer, tableColumn: NSTableColumn?, row: Int, mouseLocation: NSPoint) -> String
```

## Parameters

`tableView`

The table view that sent the message.

`cell`

The cell.

`rect`

The proposed active area of the tooltip. You can modify `rect` to provide an alternative active area.

`tableColumn`

The table column.

`row`

The row index.

`mouseLocation`

The mouse location.

## Return Value

A string that should be displayed in the tooltip. Return `nil` or the empty string if no tooltip is desired.

## Discussion

By default, `rect` is computed as

`[cell drawingRectForBounds:cellFrame]`. Note that tooltips are also known as help tags.

---

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)