更新时间:2023-02-23 17:21:20
Use the NSJSONSerialization
class to parse the JSON data.
jsonFlickrApi(...)
表示您正在使用JSONP端点与Flickr对话.您不需要这个;一个普通的JSON端点就可以了.根据此Flickr API文档,您可以通过在值中包含参数nojsoncallback
来解决此问题1
当您提出请求时.
The jsonFlickrApi(...)
indicates that you're using a JSONP endpoint to talk to Flickr. You don't need this; a plain JSON endpoint is fine. According to this Flickr API documentation you can fix this by including the parameter nojsoncallback
with the value 1
when you make your request.