I can get an array of dictionary keys sorted by values, but how to I get an array of values sorted by dictionary keys? I\'ve been looking everywhere with no luck. Any help a
One way is to construct the array of sorted dictionary keys, then create another array of the values based on the array of keys:
//Construct array of sorted keys
NSArray keyarray = ... //etc
NSMutableArray valuearray = [[NSMutableArray alloc] init];
for (id key in keyarray) {
[valuearray addObject:[dict objectForKey:key]];
}