很抱歉的長期問題,但最能概括我想做的事:如何從使用JSONKit創建的NSDictionary正確地填充UITableView NSArray?
我的JSON的樣子:
{
4e8cf1d6c7e24c063e000000 = {
"_id" = {
"$id" = 4e8cf1d6c7e24c063e000000;
};
author = faisal;
comments = (
{
author = adias;
comment = amazing;
},
{
author = nike;
comment = "I concur";
}
);
created = {
sec = 1317772800;
usec = 0;
};
text = "This is a random post";
title = "post # 1";
type = (
punjabi
);
};
4e91fd49c7e24cda74000000 = {
"_id" = {
"$id" = 4e91fd49c7e24cda74000000;
};
author = draper;
comments = (
{
author = adias;
comment = "amazing again";
}
);
created = {
sec = 1318118400;
usec = 0;
};
text = "This is a random post again";
title = "post # 2";
type = (
punjabi
);
};
}
我想什麼做的是最終具有由具有各行的UTTableview標題(文本從上面JSON):
這是我的代碼至今:
NSString *responseString = [request responseString];
NSDictionary *resultsDictionary = [responseString objectFromJSONString];
如何把一切都很g在UITableView的數組中?再次,我只是有點生疏,因爲我可以發誓我以前做過。
如果你需要鍵值,你也可以使用'[resultsDictionary allKeys]' – simonbs