我是 json 新手,我需要你的帮助。
我收到这样的 JSON 字符串:
{"network":
{
"network_id":111,
"name":"test name",
"city":"test city",
"country":"test country",
"description":"test desc"
}
}
我如何处理这个字符串并拆分键/值以便在我的视图中使用它们?
- (void) connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
NSString *responseString = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding];
self.responseData = nil;
//*********** How I can parse responseString *********//
[networkIDLabel setText:@"ADD THE VALUE"];
[nameLabel setText:@"ADD THE VALUE"];
[responseString release];
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}
谢谢