Skip to content

Instantly share code, notes, and snippets.

@azu
Created July 20, 2011 15:25
Show Gist options
  • Save azu/1095172 to your computer and use it in GitHub Desktop.
Save azu/1095172 to your computer and use it in GitHub Desktop.
// NSDictionaryをループする
NSDictionary *dict =
[NSDictionary dictionaryWithObjectsAndKeys:
@"futaba", @"name", [NSNumber numberWithInt:4], @"age",
@"white", @"color", nil];
NSArray *keys = [dict allKeys];
for (i = 0; i < [keys count]; i++) {
NSLog(@"key: %@, value: %@\n",
[keys objectAtIndex:i],
[dict objectForKey:[keys objectAtIndex:i]]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment