NSDerivedAttributeDescription
A description of an attribute that derives its value by performing a calculation on a related attribute.
Declaration
class NSDerivedAttributeDescriptionOverview
Use derived attributes to optimize fetch performance; for example:
Create a derived
searchNameattribute to reflect anameattribute with case and diacritics removed for more efficient comparison.Create a derived
relationshipCountattribute to reflect the number of objects in a relationship and avoid having to do a join.
Derived attributes support the following expressions:
Expression | Description | Example |
|---|---|---|
to-one keypath | A single value to replicate. |
|
to-one keypath with a function | The result of calling a function on a single value. [Image] Supported functions include |
|
to-many keypath with a function | The result of calling an aggregate function on a set of values. [Image] Supported functions include |
|
time | The current time. |
|