Instance Method

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.

Declaration

- (NSArray<ObjectType> *)sortedArrayWithOptions:(NSSortOptions)opts usingComparator:(NSComparator)cmptr;

Parameters

opts

A bitmask that specifies the options for the sort (whether it should be performed concurrently and whether it should be performed stably).

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.

- 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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software