iphone json解析器和NsmutableDictionary

时间:2011-12-13 06:12:27

标签: iphone json asihttprequest nsmutabledictionary

我收到了响应字符串

{"status":200,"response":
 {"data":
  [{"category_name":"Clubs","items":     
     [{"id":"4ee097a59f39d00308000004","name":"Item B","image":"/uploads/item/image/4ee097a59f39d00308000004 /thumb_cyber.png","description":"Thuudd","price":90,"monentary_type":1
     }]
   }],
 "message":"List of all the items"}}

这是我的字符串我只是解析

pro_Catagory        =   [jsonDictionary objectForKey:@"status"];

我得到了200 但以下是行不通的 它指向Null

pro_Status  =   [jsonDictionary objectForKey:@"response.data.category_name"];

我如何获得其他价值观帮助我...

1 个答案:

答案 0 :(得分:2)

你应该这样使用:

pro_status = [[[[jsonDictionary valueForKey:response] valueForKey:data] objectAtIndex:1] valueForKey:@"category_name];