简体   繁体   English

iPhone:向服务器传递数据的最佳方法

[英]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库,即TouchJSONjson-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.

相关问题 从iPhone发送实时位置数据到服务器的最佳做法 - Best practice for sending live location data to server from iPhone 从iPhone将JSON数据传递到在线服务器,并将其存储在我的在线数据库中 - Passing json data to online server from iphone its storing empty data in my online database 从iPhone上的GameLoop(主循环)传递消息的最佳方式 - Best way of message passing from GameLoop (Main loop) on iPhone 连接到远程服务器/数据库以从iPhone检索数据的最佳方法是什么 - What is the best way of connecting to a remote server/database to retrieve data from the IPhone 将数据从iPhone发布到服务器(解析数据) - posting the data from iPhone to server (parsing data ) 将图像从服务器传输到iPhone应用程序的最佳方法是什么? - What is the best way to transfer images from a server to an iPhone app? 从服务器到Android \\ iPhone客户端获取地图叠加层的最佳方法 - Best way to get map overlays from a server to Android \ iPhone client 从 Rails Server 发送 iphone 推送通知的最佳方式 - Best Way to send iphone push notifications from Rails Server 从iPhone中的服务器加载大量图像的最佳方法 - Best way to load a lot of images from a server in iphone 将数据从服务器发送到iPhone应用程序 - Send data from server to iPhone app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM