#import <Foundation/Foundation.h>
int main (int argc, const char *argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:6], @"c",
[NSNumber numberWithInt:5], @"objective c",
[NSNumber numberWithInt:3], @"c++",
[NSNumber numberWithInt:9], @"python",
[NSNumber numberWithInt:2], @"java", nil];
NSLog(@"keys:");
for (id key in dict) {
NSLog(key);
}
NSLog(@"\nvalues:");
for (id value in [dict objectEnumerator]) {
NSLog(@"%@", value);
}
[pool drain];
return 0;
}
/*
run:
keys:
python
objective c
java
c
c++
values:
9
5
2
6
3
*/