我使用 json-framework 从 URL 中提取 JSON 字符串,并NSDictionary
使用这两行代码将 JSON 字符串转换为对象
SBJsonParser* parser = [SBJsonParser new];
NSDictionary* myDict = [parser objectWithString:resp];
我的NSDicitonary
有:
(
{
condition = no;
date = "2013-06-21";
"location_id" = 9;
name = Chabahil;
reason = "";
time = "03:04:22";
},
{
condition = pressure;
date = "2013-06-21";
"location_id" = 7;
name = Maitighar;
reason = "Peak Hour";
time = "03:04:13";
}
)
现在我需要访问每个元素,例如我想获取第二个元素的“名称”值。我不知道该怎么做。谢谢!