<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPredicateEditorRowTemplate/templates(withAttributeKeyPaths:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPredicateEditorRowTemplate(cm)templatesWithAttributeKeyPaths:inEntityDescription:"
  },
  "title" : "templates(withAttributeKeyPaths:in:)"
}
-->

# templates(withAttributeKeyPaths:in:)

Returns an array of predicate templates for the given attribute key paths for a given entity.

```
class func templates(withAttributeKeyPaths keyPaths: [String], in entityDescription: NSEntityDescription) -> [NSPredicateEditorRowTemplate]
```

## Parameters

`keyPaths`

An array of attribute key paths originating at `entityDescription`. The key paths may cross relationships but must terminate in attributes.

`entityDescription`

A Core Data entity description.

## Return Value

An array of predicate templates for `keyPaths` originating at `entityDescription`.

## Discussion

This method determines which key paths in the entity description can use the same views (that is, share the same attribute type). For each of these groups, it instantiates individual templates via [`init(leftExpressions:rightExpressions:modifier:operators:options:)`](/documentation/AppKit/NSPredicateEditorRowTemplate/init(leftExpressions:rightExpressions:modifier:operators:options:)).

---

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)