I have an iPhone app, and it has a database in it that gets updated when the user does some stuff in the app. I’m concerned that when I push an update, it will push the empty database too, getting rid of all their data. How can I tell Apple to not replace the database? How can I keep all the user’s settings and information that they will not want to lose in the app?
Share
If you update data in the DB, you must already be copying it from the Resources folder to the Documents folder. Otherwise, your codesigned app would refuse to launch after the first time it inserts/updates data in the database.
Thus, all you have to do is make sure your own application doesn’t overwrite the existing database. When you update an app, the Documents folder stays untouched so from the app’s perspective it doesn’t know if it was just launched for the very first time, a second time or just updated.