<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTableView/rows(in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTableView(im)rowsInRect:"
  },
  "title" : "rows(in:)"
}
-->

# rows(in:)

Returns a range of indexes for the rows that lie wholly or partially within the vertical boundaries of the specified rectangle.

```
func rows(in rect: NSRect) -> NSRange
```

## Parameters

`rect`

A rectangle in the coordinate system of the table view.

## Return Value

A range of indexes for the table view’s rows that lie wholly or partially within the horizontal boundaries of `aRect`. If the width or height of `aRect` is `0`, this method returns an `NSRange` whose length is `0`.

## Discussion

The location of the range is the index of the first row in the rectangle, and the length is the number of rows that lie in the rectangle.

## See Also

[`-  columnsInRect:`](/documentation/AppKit/NSTableView/columnsInRect:)

Returns a range of indexes for the table view’s columns that lie wholly or partially within the horizontal boundaries of the specified rectangle.



---

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)