#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSDictionary *dic=@{@"1":@"02",
@"2":@"30",
@"3":@"11",
@"4":@"7"
};
NSArray *arr=[dic allKeys];
for ( id str in arr) {
NSLog(@"%@",str);
}
arr=[arr sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
return [obj1 compare:obj2];
}];
for(id str1 in arr){
NSLog(@"%@",str1);}
}
return 0;
}