I have an array like:
( "8461.86","8468.22","8468.22","8162.59","8164.50","7280.59" )
I try to sort this array decendingly as per following:
sortedArray = [arr_distance sortedArrayUsingComparator:^(id firstObject, id secondObject) {
return [((NSString *)firstObject) compare:((NSString *)secondObject) options:NSNumericSearch];
}];
But i got following array like:
( "7280.59","8162.59","8164.50","8461.86","8468.22","8468.22" )
Why this happen?
I also try with like
return [firstObject compare:secondObject options:NSNumericSearch];
But not getting proper sorted array.