2010-09-10 48 views
-1

我有一個NSDictionary的是,當印刷看起來像這樣的NSDictionary解析HOWTO

(
     { 
     "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" = "";\ 
    } 
) 

當我環像

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

我怎樣才能訪問fb_id = 1例如?
objectAtIndex:我似乎不存在,也沒有鑰匙。

感謝,
三通

+0

請格式化你的代碼,這很容易。 – miku 2010-09-10 23:39:41

+0

修復了這個問題。用473代表,你應該知道如何格式化你的帖子。 – EboMike 2010-09-10 23:42:52

+1

這看起來更像是一組字典。 – 2010-09-11 00:20:49

回答

0

啊我想出如何做到這一點。

所以對於循環使用這個代替

for (iNSDictionary *status in responseDict) { 
} 

這樣,那麼你可以使用[狀態objectForKey:@ 「fb_id」]訪問。

感謝,
三通