I have an NSArray like this:
how to sort NSarray float with value like this:122.00,45.00,21.01,5.90
See Question&Answers more detail:osI have an NSArray like this:
how to sort NSarray float with value like this:122.00,45.00,21.01,5.90
See Question&Answers more detail:ostry this it work for me
NSArray *array=[[NSArray alloc] initWithObjects:[NSNumber numberWithFloat:12.01],[NSNumber numberWithFloat:13.01],[NSNumber numberWithFloat:10.01],[NSNumber numberWithFloat:2.01],[NSNumber numberWithFloat:1.5],nil];
NSArray *sorted = [array sortedArrayUsingSelector:@selector(compare:)];