Instance Property

sortDescriptors

The sort descriptors to use when organizing the query results.

Declaration

@property(nonatomic, copy) NSArray<NSSortDescriptor *> *sortDescriptors;

Discussion

This property contains an array of NSSortDescriptor objects. You can add sort descriptors to a query object and change them later as needed. Each sort descriptor contains a field name of the intended record type and information about whether to sort values in that field in ascending or descending order. The default value of this property is nil, which means that records are returned in an indeterminate order.

The order of the items in the array matches the order in which the sort descriptors are applied to the results. In other words, the first sort descriptor in the array is applied first, followed by the second sort descriptor if needed, and the third, and so on.

See Also

Accessing the Query Parameters

recordType

The record type to search.

predicate

The search criteria to use when matching records.