//按升序排列数组
NSArray*arr=[NSArray arrayWithObjects:@"1",@"3",@"2",@"4",@"6",@"7",@"5",@"0",nil];
NSArray*m=[arrsortedArrayUsingComparator:^(idobj1,idobj2){
if(NSOrderedDescending==[obj1compare:obj2])
{
return(NSComparisonResult)NSOrderedDescending;
}
if(NSOrderedAscending==[obj1compare:obj2])
{
return(NSComparisonResult)NSOrderedAscending;
}
return(NSComparisonResult)NSOrderedSame; }
];
NSLog(@"m -->>%@",m );
网友评论