Tuesday, April 19, 2011

iterate a Dict in objective c


NSEnumerator *enumerator = [myDict keyEnumerator];
id key;
// extra parens to suppress warning about using = instead of ==
while((key = [enumerator nextObject]))
    NSLog(@"key=%@ value=%@", key, [myDict objectForKey:key]);
 
source:
http://stackoverflow.com/questions/1284429/is-there-a-way-to-iterate-over-an-dictionary 

No comments: