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

# row(forDisplayValue:)

Returns the index of the row containing a given value.

```
func row(forDisplayValue displayValue: Any) -> Int
```

## Parameters

`displayValue`

The display value (string, view, or menu item) of an item in the receiver. This value must not be `nil`.
  
  > Important:
  > Raises `NSInvalidArgumentException` if `displayValue` is `nil`.

## Return Value

The index of the row containing `displayValue`, or `NSNotFound`.

## Discussion

This method searches each row via pointer equality for the given display value, which may be present as an alternative in a popup menu for that row.

---

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)