NSArray *arr = @[@{@"amount":@"11090",@"date":@"2018-07-12 19:53:45",@"name":@"y"},
@{@"amount":@"1980",@"date":@"2019-07-12 19:53:45",@"name":@"d"},
@{@"amount":@"11087",@"date":@"2020-07-12 19:53:45",@"name":@"g"},
@{@"amount":@"11095",@"date":@"2020-07-18 19:53:45",@"name":@"c"},
@{@"amount":@"77",@"date":@"2018-07-12 19:53:46",@"name":@"a"}];
NSArray *arrNmaeDesc = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES]];
NSArray *arrDateDesc = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES]];
NSArray *arrAmountDesc = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"amount" ascending:YES]];
NSArray*arrNmae = [arrsortedArrayUsingDescriptors:arrNmaeDesc];
NSArray*arrDate = [arrsortedArrayUsingDescriptors:arrDateDesc];
NSArray*arrAmount = [arrsortedArrayUsingDescriptors:arrAmountDesc];
网友评论