NSMutableDictionary

NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
 [dict setObject:@"John" forKey:@"Firstname"];
 [dict setObject:@"Doe" forKey:@"Lastname"];
 [dict setObject:@"info at objectgraph.com" forKey:@"Email"];
 
 NSLog(@"%@", dict);
 
 NSArray *keys = [dict allKeys];
 
 // values in foreach loop
 for (NSString *key in keys) {
  NSLog(@"%@ is %@",key, [dict objectForKey:key]);
 }

posted on 2011-08-18 12:40  风乔  阅读(181)  评论(0编辑  收藏  举报

导航