如何解析JSON字符串? [英] How to parse JSON String?
本文介绍了如何解析JSON字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序中,我使用POST方法向服务器发送了一些请求,并在控制台上打印了JSON字符串后作出响应:
In my app, I have send some Request to server using POST Method and in response following JSON string printed on console :
[
{
"title": "American Heart Association",
"link": "www.americanheart.org/"
},
{
"title": "EverydayHealth.com",
"link": "www.everydayhealth.com"
},
{
"title": "GetFitSlowly.com",
"link": "www.getfitslowly.com"
}
]
所以,如何解析它,从这个字符串中获取标题和链接
so, how to parse it, and take title and link from this string
推荐答案
是的,就像Jhaliya发布的那样以上...
Yes as Jhaliya posted above...
教程:JSON Over HTTP On iPhone从代码下载,在代码中复制JSON库并简单
Tutorial: JSON Over HTTP On The iPhone download from code here copy JSON library in your code and simple
object = [yourResponseInString JSONValue];
object = [yourResponseInString JSONValue];
在对象中你将获得数组或字典..;)
in object you'll get Array or dictionary..;)
这篇关于如何解析JSON字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文