Sorts the receiver in ascending order, as determined by the comparison method specified by a given selector.
- iOS 2.0+
- macOS 10.0+
- tvOS 9.0+
- watchOS 2.0+
A selector that specifies the comparison method to use to compare elements in the array.
comparatormessage is sent to each object in the array and has as its single argument another object in the array. The
comparatormethod should return
NSOrderedif the array is smaller than the argument,
NSOrderedif the array is larger than the argument, and
NSOrderedif they are equal.