我正在尝试从提供 JSON 的 Web 服务中获取一些数据。但我不知道我的代码出了什么问题。它看起来很简单,但我无法获得任何数据。
这是代码:
NSURLRequest *request = [NSURLRequest requestWithURL:URL];
AFJSONRequestOperation *operation = [AFJSONRequestOperation
JSONRequestOperationWithRequest:request
success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
DumpDic = (NSDictionary*)[JSON valueForKeyPath:@"description"] ;
}
failure:nil
];
[operation start];
AboutTXT = [DumpDic objectForKey:@"description"];
这是JSON URL。
编辑
来自 URL 的 JSON:
{
"clazz":"AboutList",
"description":{
"clazz":"DescriptionContent",
"description":"ASTRO Holdings Sdn. Bhd. (AHSB) Group operates through two holding companies – ASTRO Overseas Limited (AOL) which owns the portfolio of regional investments and ASTRO Malaysia Holdings Sdn Bhd (AMH / ASTRO) for the Malaysian business, which was privatized in 2010 and is currently owned by Usaha Tegas Sdn Bhd/its affiliates, and Khazanah Nasional Berhad."
},
"id":{
"inc":-1096690569,
"machine":1178249826,
"new":false,
"time":1339660115000,
"timeSecond":1339660115
},
"refKey":"AboutList"
}