Retrieving data from a remote database

前端 未结 2 1199
醉话见心
醉话见心 2021-02-06 16:03

could someone please explain to me the process of retrieving data from a remote database? I understand how to parse data from sqlite to an iPhone application however remote data

2条回答
  •  臣服心动
    2021-02-06 16:49

    1. If you have a web service protocol on the server side, you can use JSON based web service to retrieve your data. If you follow any JSON tutorial, you can see JSON is just a text representation of the data.

    2. Or you can simply use a post request to your server, which can response by simple XML with your own defined tag. So that you can use NSXMLParser to parse the data in your iPhone and decode information from there.

    Any kind of database in the remote site will work. I prefer the free open source MySQL database.

    With JSON web servie, you need some JSON converter for your database in the server side and also in the client side. A good open source client tool is SBJSONParser.

    But if you use XML, you can define your own tag to encode and decode you database fields and information.

提交回复
热议问题