RosettaCodeData/Task/Associative-array-Iteration/Objective-C/associative-array-iteration-3.m

10 lines
423 B
Mathematica
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
NSDictionary *myDict = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:13], @"hello",
[NSNumber numberWithInt:31], @"world",
[NSNumber numberWithInt:71], @"!", nil];
// iterating over keys and values:
[myDict enumerateKeysAndObjectsUsingBlock: ^(id key, id value, BOOL *stop) {
NSLog(@"key = %@, value = %@", key, value);
}];