解决方法
谷歌搜索后,我没有找到任何教程,但使用JSONKit应该是自我解释.
使用NSURLConnection或ASIHTTPRequest下载JSON源后,只需创建JSON源中所有对象的字典,如下所示:
//jsonString is your downloaded string JSON Feed NSDictionary *deserializedData = [jsonString objectFromJSONString]; //Helpful snippet to log all the deserialized objects and their keys NSLog(@"%@",[deserializedData description]);
创建字典后,您可以执行以下操作:
NSString *string = [deserializedData objectForKey:@"someJSONKey"];
这就是JSONKit背后的基础知识.
JSONKit当然要强大得多,你可以在JSONKit.h中找到一些你可以用它做的其他事情.