| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
9年前发布

iOS数组的快速排序

  //  方法1:NSComparator             NSArray *listGroupname = [self.listTeams sortedArrayUsingComparator:^(NSString *n1,NSString *n2) {                     NSString *val1 = [[NSString alloc]init];                     NSString *val2 = [[NSString alloc]init];                     if (val1 > val2) {                             return  NSOrderedAscending;                         } else {                             return NSOrderedDescending;                         }             }];      NSLog(@"%@",listGroupname);