Take the 2-minute tour ×

I have some table columns in database say: office, hallName and floor. I have some set of values in this table. I need to fetch these values and view it on the tableview. So i need to use NSMutableDictionary with for loop to get all the values in database. Can someone pls give me some idea for looping this dictionary? Thanks

share|improve this question
what u had tried yet? –  Girish Jan 24 '13 at 5:57
add comment

2 Answers

up vote 0 down vote accepted

Enumerating over NSDictionary is most effectively done using

[dictionary enumerateKeysAndObjectsWithOptions:NSEnumerationReverse usingBlock:^(id key, id obj, BOOL *stop) {


This way you get access to both the key and object in one simple shot.

share|improve this answer
add comment

This might help you

NSString *key;
for(key in someDictionary){
     NSLog(@"Key: %@, Value %@", key, [someDictionary objectForKey: key]);
share|improve this answer
Ya i got it :) thanks :) –  user1999892 Jan 24 '13 at 6:03
@user1999892 Then accept the answer... –  Murali Jan 24 '13 at 6:04
His points are too low to accept answers. Upvote his question to award him points perhaps. –  Chris Wagner Jan 24 '13 at 6:07
add comment

Your Answer


