-(NSArray *)sortArrayByComparator:(NSArray *)arr
{
return [arr sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
ChatMessageInfo *info1 = obj1;
ChatMessageInfo *info2 = obj2;
if (info1.sendDate > info2.sendDate) {
returnNSOrderedDescending;
}else if(info1.sendDate < info2.sendDate){
returnNSOrderedAscending;
}else{
return NSOrderedSame;
}
}];
}