// 对dataSourceArray按timestamp的顺序进行降序排列 YES升序、NO降序
NSSortDescriptor *descriptor = [NSSortDescriptor sortDescriptorWithKey:@"timestamp" ascending:NO];
NSArray*descriptors = [NSArray arrayWithObject: descriptor];
//进行排序
[dataSourceArray sortUsingDescriptors: descriptors ];
YES升序 NO降序
网友评论