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:
-
App loads.
-
App looks for a connection to XML Host.
-
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.
-
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/