Instance Method

initWithKey:ascending:comparator:

Initializes a sort descriptor with a given key path and ordering, and a comparator block.

Declaration

- (instancetype)initWithKey:(NSString *)key ascending:(BOOL)ascending comparator:(NSComparator)cmptr;

Parameters

key

The property key to use when performing a comparison.

For information about key paths, see Key-Value Coding Programming Guide.

ascending

YES if the receiver specifies sorting in ascending order, otherwise NO.

cmptr

A comparator block.

Return Value

A sort descriptor initialized with the specified key, ordering, and comparator.

See Also

Initializing a Sort Descriptor

+ sortDescriptorWithKey:ascending:

Creates and returns a sort descriptor with the specified key path and ordering.

- initWithKey:ascending:

Initializes a sort descriptor a given key path and sort order.

+ sortDescriptorWithKey:ascending:selector:

Creates a sort descriptor with the specified key path, ordering, and comparison selector.

- initWithKey:ascending:selector:

Initializes a sort descriptor with a given key path, ordering, and comparison selector.

+ sortDescriptorWithKey:ascending:comparator:

Creates and returns a sort descriptor initialized with the specified key path and ordering, and a comparator block.