NSMutableArray *nearby = [[NSMutableArray alloc]init];
[nearby addObject:[mutableArray objectAtIndex:x]];
[[nearby objectAtIndex:x] setValue:[NSNumber numberWithFloat:distance] forKey:@"Km"];
Sort mutableArray according to the "Km" with accending
NSSortDescriptor * sort = [[NSSortDescriptor alloc] initWithKey:@"Km" ascending:YES];
NSArray *sa = [nearby sortedArrayUsingDescriptors:[NSArray arrayWithObject:sort]];
No comments:
Post a Comment