ios 排序
/**
数组排序 array=要排序的数组 attribute=要排序的字段 asc=是否是升序
排序完 传进来的引用array 就是排序后的结果
*/
void arraySort(NSMutableArray * array, NSString *attribute, BOOL asc){
NSMutableArray *sortDescriptors = [NSMutableArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:attribute ascending:asc]];
[array sortUsingDescriptors:sortDescriptors ];
}
/**
时间 转换
*/
NSString* formatTimeByInt(int time, NSString *format){
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
NSDate *date1 = [NSDate dateWithTimeIntervalSince1970:time];
[dateFormatter setDateFormat:format];
NSString *resultTime = [dateFormatter stringFromDate:date1];
[dateFormatter release];
return resultTime;
}
补充:移动开发 , IOS ,