iOS数组排序
//手动排序下
[arr sortUsingComparator:^NSComparisonResult(RoomUserInfo *obj1, RoomUserInfo *obj2) {
if ([obj2.location longLongValue] > [obj1.location longLongValue])
{
return NSOrderedAscending ;
}
else if ([obj2.location longLongValue] == [obj1.location longLongValue])
{
return NSOrderedSame;
}
else
{
return NSOrderedDescending;
}
}];
发表回复