[英]iPhone: Best Method for Passing Data to and from a Server
I am developing an iPhone application that downloads data from a website. 我正在开发一个iPhone应用程序,该程序可以从网站下载数据。 The website database is implemented in SQL and the site itself uses the classic ASP interface.
网站数据库用SQL实现,网站本身使用经典的ASP界面。
I am unsure as to which method would be best for transferring data to and from the server. 我不确定哪种方法最适合与服务器之间进行数据传输。 Both JSON and SOAP require XML processing and I'm not sure how that affects performance or which of those two is best.
JSON和SOAP都需要XML处理,但我不确定这会如何影响性能或两者中哪一个最好。
What would be the best method in general for data transfer given the server configuration we currently have? 考虑到我们当前拥有的服务器配置,一般而言,最佳的数据传输方法是什么?
I very new to this field and I'm a bit confused. 我对这个领域很陌生,我有点困惑。 Any help would be appreciated.
任何帮助,将不胜感激。
JSON is generally much simpler to use than SOAP (or any XML format), and SOAP support in objective-c is very limited. JSON通常比SOAP(或任何XML格式)更易于使用,而Objective-c中的SOAP支持非常有限。 I'm not sure about performance, but JSON doesn't use any XML parsing.
我不确定性能,但是JSON不使用任何XML解析。 There are two good JSON libraries for iPhone, TouchJSON and json-framework --they're pretty similar, but I've heard that TouchJSON might be more actively maintained.
iPhone有两个不错的JSON库,即TouchJSON和json-framework,它们非常相似,但是我听说TouchJSON可能会得到更积极的维护。 I've never used ASP, but this question has some resources for JSON libraries.
我从未使用过ASP,但是这个问题为JSON库提供了一些资源。
using a Plist in my opinion is the best option, it's basically an apple specific XML format that can be converted into NSObjects in a single line of code on any iOS system and it is by far the fastest. 在我看来,使用Plist是最好的选择,它基本上是一种Apple特定的XML格式,可以在任何iOS系统上的单行代码中将其转换为NSObjects,这是迄今为止最快的。
See this question: create Plist in .net from list of objects 看到这个问题: 从对象列表中在.net中创建Plist
I use it to load over 100,000 objects for syncing to my iPad Core Data app, works like a champ. 我用它来加载超过100,000个对象以同步到我的iPad Core Data应用程序,就像冠军一样。 Watch the video link posted on that question, very informative.
观看有关该问题的视频链接,内容非常丰富。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.