数组按对象的属性排序

来源:互联网 发布:word转pdf软件 编辑:程序博客网 时间:2024/05/21 00:17
   [ 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;   }];
2 0