标签:
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSArray *arr=[[NSArray alloc]initWithObjects:@12,@9,@34,@56,@11, nil];
NSArray *newarr=[arr sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
return [obj1 compare:obj2];
}];
for (NSString *str in newarr) {
NSLog(@"%@",str);
}
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/haitong-0311/p/5120325.html