Instance Method

sortedArrayUsingComparator:

Returns an array that lists the receiving ordered set’s elements in ascending order, as determined by the comparison method specified by a given NSComparator block

Declaration

- (NSArray<ObjectType> *)sortedArrayUsingComparator:(NSComparator)cmptr;

Parameters

cmptr

A comparator block.

Return Value

An array that lists the receiving ordered set’s elements in ascending order, as determined by the comparison method specified cmptr.

See Also

Creating a Sorted Array

- sortedArrayUsingDescriptors:

Returns an array of the ordered set’s elements sorted as specified by a given array of sort descriptors.

- sortedArrayWithOptions:usingComparator:

Returns an array that lists the receiving ordered set’s elements in ascending order, as determined by the comparison method specified by a given NSComparator block.