douxugu5836 2013-04-29 23:19
浏览 34
已采纳

将数据发送到iOS设备

I need some pro advice.

I'm working on an iPhone app that sends and receives a reasonable amount of data for one HTTP round trip.

  1. The device sends a POST request to the server
  2. The server responds with the data needed for the device

Initially the server was sending XML back to the device, where the device parsed it and stored it within its sqlite3 database. But I've been thinking... why do I need to encode the data within XML, break it apart, then write a query client-side to store the data. Why can't I use the server to write the queries, and simply execute them on the device?

There may be a security threat here, perhaps, and I would love to hear what exactly that may be, but I'm not convinced that I absolutely need to encode the data in XML; unless I was building an API of some sort.

Anyways, I've been thinking about this problem for quite some time (I'm still very new to programming) and I would absolutely love some expert advice on this.

Thank you for your time,

Rob

  • 写回答

1条回答 默认 最新

  • dpblwmh5218 2013-04-30 01:28
    关注

    You got a couple of options for data transmission:

    1) For security you can use SSL via NSURLConnection.

    2) You can use JSON instead on XML. Take a look at NSJSONSerialization.

    3) Or depending on your server side and app needs, you could just send plain HTML (text).

    It's kinda hard to give you more detailed input without knowing some specifics of what you are trying to do.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突