IOS开发解析接口时数据带反斜杠怎么处理?
例如这样的数据:[{"ad_id":102,"pos":"home","is_gif":0,"is_show":0,"photo":"http:\/\/static.me...
例如这样的数据:
[{"ad_id":102,"pos":"home","is_gif":0,"is_show":0,"photo":"http:\/\/static.meishij.net\/images\/mobileimg\/dntg_640x100.jpg","click_type":4,"click_obj":"\u7f8e\u98df\u6770\u65b0\u6625\u5609\u5e74\u534e\uff0c\u9001\u7535\u5f71\u7968;http:\/\/m.meishij.net\/huodong\/dianyingpiao.php?from=ioshome"},{"ad_id":101,"pos":"list","is_show":0,"is_gif":0,"photo":"http:\/\/static.meishij.net\/images\/get\/mssjk_640x100.jpg","click_type":4,"click_obj":"\u5c81\u672b\u5609\u5e74\u534e\uff0c\u9a6c\u4e0a\u9001\u5065\u5eb7;http:\/\/m.meishij.net\/huodong\/xuetangyi.php"}]图片带反斜杠怎么取出呢?顺便问下解析的cid=%E5%B7%9D%E8%8F%9C 这是乱码吗!是否接口已经加密,新手请多关照! 展开
[{"ad_id":102,"pos":"home","is_gif":0,"is_show":0,"photo":"http:\/\/static.meishij.net\/images\/mobileimg\/dntg_640x100.jpg","click_type":4,"click_obj":"\u7f8e\u98df\u6770\u65b0\u6625\u5609\u5e74\u534e\uff0c\u9001\u7535\u5f71\u7968;http:\/\/m.meishij.net\/huodong\/dianyingpiao.php?from=ioshome"},{"ad_id":101,"pos":"list","is_show":0,"is_gif":0,"photo":"http:\/\/static.meishij.net\/images\/get\/mssjk_640x100.jpg","click_type":4,"click_obj":"\u5c81\u672b\u5609\u5e74\u534e\uff0c\u9a6c\u4e0a\u9001\u5065\u5eb7;http:\/\/m.meishij.net\/huodong\/xuetangyi.php"}]图片带反斜杠怎么取出呢?顺便问下解析的cid=%E5%B7%9D%E8%8F%9C 这是乱码吗!是否接口已经加密,新手请多关照! 展开
3个回答
展开全部
需要Json解析 可以用
NSError *error;
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:
request.responseData options:NSJSONReadingMutableLeaves error:&error];
NSError *error;
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:
request.responseData options:NSJSONReadingMutableLeaves error:&error];
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2014-01-23
展开全部
这个不是乱码,只是中文用unicode编码过来。再用unicode转码回来就好了。
追问
http:\/\/static.meishij.net\/images\/mobileimg\/dntg_640x100.jpg 这个图片路径没有问题吗?也是这样Json解析吗
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这是json解析,使用SBJson解析就行,不过图片部分使用了unicode编码
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询