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

# outlineView(_:heightOfRowByItem:)

Returns the height in points of the row containing `item`.

```
@MainActor optional func outlineView(_ outlineView: NSOutlineView, heightOfRowByItem item: Any) -> CGFloat
```

## Parameters

`outlineView`

The outline view that sent the message.

`item`

The row item.

## Return Value

The height of the row.

## Discussion

Values returned by this method should not include intercell spacing and must be greater than `0`.

Implement this method to support an outline view with varying row heights.

For large tables in particular, you should make sure that this method is efficient. `NSOutlineView` may cache the values this method returns, so if you would like to change a row’s height make sure to invalidate the row height by calling [`noteHeightOfRows(withIndexesChanged:)`](/documentation/AppKit/NSTableView/noteHeightOfRows(withIndexesChanged:)). `NSOutlineView` automatically invalidates its entire row height cache in [`reloadData()`](/documentation/AppKit/NSTableView/reloadData()) and [`noteNumberOfRowsChanged()`](/documentation/AppKit/NSTableView/noteNumberOfRowsChanged()).

If you call [`view(atColumn:row:makeIfNecessary:)`](/documentation/AppKit/NSTableView/view(atColumn:row:makeIfNecessary:)) or [`rowView(atRow:makeIfNecessary:)`](/documentation/AppKit/NSTableView/rowView(atRow:makeIfNecessary:)) within your implementation of this method, an exception is thrown.

> Important:
> To avoid the possibility of a hang due to unexpected recursion, don’t call geometry-calculating methods such as ``doc://com.apple.appkit/documentation/AppKit/NSView/bounds``, ``doc://com.apple.appkit/documentation/AppKit/NSTableView/rect(ofColumn:)``, or any `NSTableView` method that calls ``doc://com.apple.appkit/documentation/AppKit/NSTableView/tile()`` within your implementation of 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)