直接来段代码:
// 按日期排序
NSArray *sortedArray = [array sortedArrayUsingComparator:^(id obj1, id obj2){
NSDate *date1 = [obj1 objectForKey:RecordDateKey];
NSDate *date2 = [obj2 objectForKey:RecordDateKey];
return [date1 compare:date2];
}];
搞定。
IOS中常用排序,参考博客:http://blog.csdn.net/ch_soft/article/details/7669811