// 方法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);
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/5142.html