我有以下 JSON!
这个 JSON 写了我的熊醉伏特加:D
{
"Label": [ 1, 2, 3, 4, 5 ],
"ViewId": 1
}
代码:
NSURL * url = [NSURL URLWithString:getDataURL];
NSData * data = [NSData dataWithContentsOfURL:url];
json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
for (int i=0; i < json.count; i++)
{
NSString * FRid = [[json objectAtIndex:i] objectForKey:@"ViewId"]; //it's work
NSString * FRName = [[json objectAtIndex:i] objectForKey:@"Label"]; //it's don't work Out of scope
如何从“Label”获取数据到 NSString?