tags:

views:

39

answers:

1

Hi,

I have an NSDictionary that when printed looks like this

(
        {
        "current_game" = 1;
        "fb_id" = 1;
        "game_status" = 1;
    },
        {
        "current_game" = 4;
        "fb_id" = 2;
        "game_status" = 1;
    },
        {
        "current_game" = "";
        "fb_id" = 3;
        "game_status" = "";
    },
        {
        "current_game" = "";
        "fb_id" = 4;
        "game_status" = "";\
    }
)

When I loop it like

for (int i=0; i < [responseDict count]; i++) {  
}

How can I access fb_id = 1 for example?
objectAtIndex:i doesn't seem to exist and there is no key there either.

Thanks,
Tee

A: 

Ah I figured out how to do it.

So for the looping use this instead

for (iNSDictionary *status in responseDict) {  
}

That way then you can use [status objectForKey:@"fb_id"] to access.

Thanks,
Tee

teepusink