NSJSONSerialization [英] NSJSONSerialization
本文介绍了NSJSONSerialization的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我遇到一些公共json服务的问题
这样的服务格式化
I have problems with some public json services with serveices formatted this way
jsonFlickrFeed({
"title": "Uploads from everyone",
"link": "http://www.flickr.com/photos/",
"description": "",
"modifi ... })
NSJSONSerialization似乎无法开展工作
NSJSONSerialization seems to be unable to make its work
NSURL *jsonUrl = [NSURL URLWithString:@"http://d.yimg.com/autoc.finance.yahoo.com/autoc?query=yahoo&callback=YAHOO.Finance.SymbolSuggest.ssCallback"];
NSError *error = nil;
NSData *jsonData = [NSData dataWithContentsOfURL:jsonUrl options:kNilOptions error:&error];
NSMutableDictionary *jsonResponse = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingAllowFragments error:&error];
NSLog(@"%@", jsonResponse);
推荐答案
使用最新的网络API解决了我的问题。
Using the latest web API I have solved my problem.
作为参考,旧的网络API 是:
http://api.flickr.com/services/feeds/photos_public.gne?id=xxxxxxxx&lang=en-us&format = json
已完成。
这篇关于NSJSONSerialization的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文