I am trying to sort an array of prices from low to high. I work, but not the way I want. In short, the sorter puts the numbers as follows: 100 10,900 200,290
instead of sorting the type
100 200 290 10900
here is my code i am doing this with.
-(void)filterPriceLowHigh { NSSortDescriptor *sortDescriptor; sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"ListPrice" ascending:YES] autorelease]; NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor]; NSArray *sortedArray; sortedArray = [app.vehiclesArrayToDisplay sortedArrayUsingDescriptors:sortDescriptors]; [app.vehiclesArrayToDisplay removeAllObjects]; [app.vehiclesArrayToDisplay addObjectsFromArray:sortedArray]; }
Can someone tell me what I need to do here? thanks in advance.
Louie Dec 28 '10 at 23:32 2010-12-28 23:32
source share