开发者

Update and Insert Bulk XML Data into my SQLite Database

开发者_开发技巧I want to download a hosted XML document into my app's bundled SQLite database, updating existing rows, or inserting new rows of data as necessary.

My thoughts as far as app design are this:

  1. App loads.

  2. App looks for a connection to XML Host.

  3. If connection exists, App consumes the hosted XML document, updating row and column data in the bundled SQLite database, adding any new rows if new rows exist in the XML document. If no connection exists, App uses the previously stored data in the SQLite database.

  4. User has a merry time using the app, oblivious to the state of the data.

Is this the right approach? Is there a better way to do this? How do I do bulk inserts and updates from an XML document into my SQLite database. I've only seen examples of how to do this row by row. My data is hundreds of rows by 10 columns.

Any insight is greatly appreciated. lq


I found a link that answers my question and provides a working example of taking an XML document and inserting it into a SQLite database: http://blog.sallarp.com/iphone-core-data-uitableview-drill-down/


I think your idea is ok.. I have developed "Movie Vault for iPad" app and its doing the exactly same thing. This app also have lot of movies data to download and its working quite well. You can also do one thing you can give a "Refresh" button and when user click/tap on this button you can download the xml and insert it in database in a secondary thread.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜