NSArray *sortArray = @[
@{
@"id" : @"001",
@"name" : @"yanghuixue",
@"create_time" : @"1001"
},
@{
@"id" : @"002",
@"name" : @"yanghuixue",
@"create_time" : @"1002"
},
@{
@"id" : @"003",
@"name" : @"yanghuixue",
@"create_time" : @"1003"
},
@{
@"id" : @"004",
@"name" : @"yanghuixue",
@"create_time" : @"1004"
}
];
- (NSArray *)sortArray:(NSArray *)array
{
NSArray *sortDesc = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"create_time" ascending:YES]];
NSArray *sortedArr = [array sortedArrayUsingDescriptors:sortDesc];
return sortedArr;
}