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

# ruleEditor(_:displayValueForCriterion:inRow:)

Returns the value for a given criterion.

```
@MainActor func ruleEditor(_ editor: NSRuleEditor, displayValueForCriterion criterion: Any, inRow row: Int) -> Any
```

## Parameters

`editor`

The rule editor that sent the message.

`criterion`

The criterion for which the value is required.

`row`

The row number of `criterion`.

## Return Value

The value for `criterion`.

## Discussion

The value should be an instance of `NSString`, `NSView`, or `NSMenuItem`. If the value is an `NSView` or `NSMenuItem`, you must ensure it is unique for every invocation of this method; that is, do not return a particular instance of `NSView` or `NSMenuItem` more than once.

### Special Considerations

The delegate must implement 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)