Skip to content

Instantly share code, notes, and snippets.

@akio0911
Created May 22, 2009 08:01
Show Gist options
  • Save akio0911/116010 to your computer and use it in GitHub Desktop.
Save akio0911/116010 to your computer and use it in GitHub Desktop.
#import <Foundation/Foundation.h>
int main() {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:63], @"Mathematics",
[NSNumber numberWithInt:72], @"English",
[NSNumber numberWithInt:55], @"History",
[NSNumber numberWithInt:49], @"Geography",
nil];
NSLog(@"%@", dict);
NSArray *sortedKeysArray = [dict keysSortedByValueUsingSelector:@selector(compare:)];
NSLog(@"%@", sortedKeysArray);
[pool release];
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment