我是iphone的新手,无法理解如何解析这些数据,以便我将在表格视图中显示结果。当我调用megento的api时,以下数据是AFHTTPRequestOperation的结果。
{
"callforprice_id" = 13;
country = Austria;
"created_time" = "2013-05-03 12:03:05";
emailid = "indies.tester@gmail.com";
message = hfhftrfygjh;
name = "Richard Conover";
"phone_no" = 8977896;
"product_name" = Ottoman;
"product_options" = "";
"update_time" = "0000-00-00 00:00:00";
},
{
"callforprice_id" = 12;
country = "Antigua and Barbuda";
"created_time" = "2013-05-03 12:01:24";
emailid = "indies.tester@gmail.com";
message = sdfsdfsdfwe;
name = "Richard Conover";
"phone_no" = 5645;
"product_name" = Ottoman;
"product_options" = "";
"update_time" = "0000-00-00 00:00:00";
},
{
"callforprice_id" = 11;
country = Angola;
"created_time" = "2013-05-03 11:58:51";
emailid = "indies.tester@gmail.com";
message = 6tyrtyryrty;
name = "Kaitlyn Matheson";
"phone_no" = 564564;
"product_name" = Ottoman;
"product_options" = "";
"update_time" = "0000-00-00 00:00:00";
}
答案 0 :(得分:1)
如果你想在UITableview
中显示数据然后使用这个,那就试试这个。,
NSString *str=[[resultArray objectAtIndex:indexPath.row] valueForKey:@"country"];
(OR)
获取字典
等数据for(NSDictionary *dict in resultArray){
NSString *str=[dict valueForKey:@"country"];
}
答案 1 :(得分:1)
答案 2 :(得分:1)