Logo

Programming-Idioms

History of Idiom 100 > diff from v58 to v59

Edit summary for version 59 by programming-idioms.org:
[Obj-C] +DemoURL

Version 58

2020-10-10, 23:04:04

Version 59

2020-12-16, 20:50:53

Idiom #100 Sort by a comparator

Sort elements of array-like collection items, using a comparator c.

Idiom #100 Sort by a comparator

Sort elements of array-like collection items, using a comparator c.

Variables
items,c
Variables
items,c
Extra Keywords
list
Extra Keywords
list
Imports
@import Foundation;
Imports
@import Foundation;
Code
[items sortUsingComparator:c];
Code
[items sortUsingComparator:c];
Comments bubble
Sorts in-place; for creation of a new sorted array leaving the receiver unchanged there's sortedArrayUsingComparator:
Comments bubble
Sorts in-place; for creation of a new sorted array leaving the receiver unchanged there's sortedArrayUsingComparator:
Doc URL
https://developer.apple.com/documentation/foundation/nsmutablearray/1414904-sortusingcomparator