NSArray *arr = @[@{@"age": @"10",@"name":@"name1"},
@{@"age": @"12",@"name":@"name1"},
@{@"age": @"16",@"name":@"name1"},
@{@"age": @"14",@"name":@"name1"}
];
//请按照age从高到低将数组中的字典进行排序
[arr sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
return [[obj1 objectForKey:@"age"] compare:[obj2 objectForKey:@"age"]] * -1;
}];