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

# row(forItem:)

Returns the row associated with a given item.

```
func row(forItem item: Any?) -> Int
```

## Parameters

`item`

An item in the receiver.

## Return Value

The row associated with `item`, or `–1` if `item` is `nil` or cannot be found.

---

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)