我只想使用 SBJSON 框架在 Objective-C 中解析这个 JSON 字符串,并检索三个数据单元:
{"x":"197","y":"191","text":"this is a string"}
如何才能做到这一点?
NSString * jsonString = @"{\"x\":\"197\",\"y\":\"191\",\"text\":\"this is a string\"}";
SBJSON *jsonParser = [[SBJSON alloc] init];
NSDictionary * dictionary = [jsonParser objectWithString:jsonString];
NSLog(@"x is %@",[dictionary objectForKey:@"x"]);
[jsonParser release];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)