iPhone:解析字符串
嘿,我有一个这种格式的响应字符串
,好吧,我原来的响应字符串是这样的
{
"data": [
{
"name": "Santa Fe Plaza",
"category": "Landmark",
"location": {
"city": "Santa Fe",
"state": "NM",
"country": "United States",
"latitude": 35.687071155202,
"longitude": -105.93767717603
},
"id": "108196762542063"
},
{
"name": "Museum of Contemporary Native Arts",
"category": "Museum/art gallery",
"location": {
"street": "108 Cathedral Place",
"city": "Santa Fe",
"state": "NM",
"country": "United States",
"zip": "87501",
"latitude": 35.686915835451,
"longitude": -105.93725120129
},
"id": "106209180361"
}
] 一点
我必须从那里提取所有名称请告诉我如何实现这 JSON 解析器一直抛出错误
提前感谢
Hey I have a response string in this format
ok my original resonse string is like this
{
"data": [
{
"name": "Santa Fe Plaza",
"category": "Landmark",
"location": {
"city": "Santa Fe",
"state": "NM",
"country": "United States",
"latitude": 35.687071155202,
"longitude": -105.93767717603
},
"id": "108196762542063"
},
{
"name": "Museum of Contemporary Native Arts",
"category": "Museum/art gallery",
"location": {
"street": "108 Cathedral Place",
"city": "Santa Fe",
"state": "NM",
"country": "United States",
"zip": "87501",
"latitude": 35.686915835451,
"longitude": -105.93725120129
},
"id": "106209180361"
}
]
}
I have to extract all the names from there Please enlighten me how to achieve this
JSON parser is throwing error all the time
Thanx in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先下载 JSON 框架
以及开始学习的好教程:iPhone 的 JSON 框架
另请参阅:如何解析 JSON iPhone 上的文件在 Objective-C 中转换为 NSArray 和 NSDictionary
Start by downloading the JSON framework
And a Good Tutorial to Start learning: JSON Framework for iPhone
Also see: How to parse JSON files on iPhone in Objective-C into NSArray and NSDictionary