[ arr sortedArrayUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) {
if ([obj1 floatValue] > [obj2 floatValue]) {
return NSOrderedDescending;
}
if ([obj1 floatValue] < [obj2 floatValue]) {
return NSOrderedAscending;
}
return NSOrderedSame;
}];
数组按对象的属性排序
最新推荐文章于 2021-12-13 16:45:08 发布