排序 只适用于NSString
NSMutableArray *ary = [@[] mutableCopy];
int i = 10;
while (i >= 0) {
i --;
[ary addObject:[NSString stringWithFormat:@"%d", arc4random()%20]];
}
[ary sortUsingComparator:^NSComparisonResult(id obj1, id obj2) {
return [obj1 localizedStandardCompare:obj2];
}];
时间: 2024-11-05 18:54:49