---
title: "row(forDisplayValue:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsruleeditor/row(fordisplayvalue:)"
---

# row(forDisplayValue:)

Returns the index of the row containing a given value.

## Declaration

```swift
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

Return Value The index of the row containing displayValue, or NSNotFound.

## Discussion

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.

## See Also

### Obtaining Row Information

- [numberOfRows](appkit/nsruleeditor/numberofrows.md)
- [parentRow(forRow:)](appkit/nsruleeditor/parentrow(forrow:).md)
- [rowType(forRow:)](appkit/nsruleeditor/rowtype(forrow:).md)
- [NSRuleEditor.RowType](appkit/nsruleeditor/rowtype.md)
- [subrowIndexes(forRow:)](appkit/nsruleeditor/subrowindexes(forrow:).md)
