Reputation: 14918
I have an app which has an SQLite database that is stored in ./Library/Caches
. If the db is not there (e.g. first time install or iOS cleaning the Caches directories when low on space) then I copy a version of the database from the application bundle. So far so good. Now I'm about to release an update to the App Store which adds a new column to one of the tables in the DB. Can I assume that when the app is updated the contents of its ./Library/Caches
folder will be deleted, or do I need to start versioning my database so that I know when an old version is there?
On the simulator and on my test iPhone I didn't have the problem because I deleted the app first and re-installed it from Xcode.
Upvotes: 1
Views: 969
Reputation: 52565
No, the cache directory is not (always) cleared when you update an app. You need to version your database.
Upvotes: 4