开发者

How to insert data coming from web service into sql database in iphone?

开发者 https://www.devze.com 2023-01-15 07:23 出处:网络
I am developing an app where I need to insert data coming from web service into sqlite3 database.Web service returns XML data with 5 tags.Now after XML parsing h开发者_开发问答ow to insert parsed data

I am developing an app where I need to insert data coming from web service into sqlite3 database.Web service returns XML data with 5 tags.Now after XML parsing h开发者_开发问答ow to insert parsed data into sql database? Can I code for this??? Thanks in advance..


Inserting XML data in sqlite database is no different that inserting any data. So there are 3 parts of the problem you are trying to solve:

  • Calling the web service and getting the data
  • Parsing the data and populating some object
  • Inserting that data in sqlite database which has columns as per your object structure

NSURLConnection and NSXMLParser are the classed you need to look at for solving first 2 problems. Third one would be solved using sqlite library. Without more information about object structure it is difficult to suggest anything else. But you should find enough documentation on using sqlite if you search around.

0

精彩评论

暂无评论...
验证码 换一张
取 消