如何使用iPhone sdk将XML字符串转换为JSON [英] How to convert XML string to JSON using iPhone sdk

查看:103
本文介绍了如何使用iPhone sdk将XML字符串转换为JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在实施基于客户端的应用程序。我有一个xml字符串。我需要将其转换为JSON格式并发送到服务器。我不知道转换它。你能告诉我任何文档或想法吗?

I am implementing a client based application. In that I have an xml string. I need to convert it to JSON format and send to the server. I have no idea on converting this. Can you guys please suggest me any documentation or idea to this?

推荐答案

步骤#1:将XML读入NSDictionary: http://troybrant.net/blog/2010/09/simple-xml -to-nsdictionary-converter /

Step #1: Read XML into NSDictionary: http://troybrant.net/blog/2010/09/simple-xml-to-nsdictionary-converter/

步骤2:将NSDictionary转换为JSON: http://code.google.com/p/json-framework/

Step #2: Convert NSDictionary into JSON: http://code.google.com/p/json-framework/

这篇关于如何使用iPhone sdk将XML字符串转换为JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆