我正在从UPX服务器接收JSON数组,但无法获取值
我需要"relation_data“中的对象"name”,但无法进入"relation_data“
我就是这么做的
NSLog(@"All of the arrays: %@", json);
NSDictionary *Allinfo = [json objectForKey:@"response"];//I go into "response"
NSLog(@"All with response array: %@", Allinfo);
NSDictionary *datainfo = [Allinfo objectForKey:@"data"];//i go into "data"
NSLog(@"Data : %@", datainfo);但是如何进入"relation_data“并获得"name”的值呢?
response = (
data = (
{
"business_data_rev" = 12;
"contact_set_rev" = 15;
currency = EUR;
"date_added" = "2011-08-31 12:10:59.338664+02";
"date_invoiced" = "2011-08-31 12:10:59.338664+02";
"date_modified" = "2011-08-31 12:11:04.45442+02";
"date_paid" = "2011-08-31 12:10:59.408335+02";
description = "";
id = 104;
name = "Invoice #104";
"person_rev" = 12;
realid = 104;
"relation_data" = {
id = 12;
iscreditor = 0;
isdebitor = 1;
isprivate = 0;
name = "Emre.";
"subaccount_id" = 9;
};
)发布于 2011-08-31 21:22:07
尝尝这个
[dataInfo valueForKeyPath:@"relation_data.name"];https://stackoverflow.com/questions/7257474
复制相似问题