Where do I properly place sqlite database so it wouldn't get removed on app update from appstore?

StackOverflow https://stackoverflow.com/questions/22979307

  •  30-06-2023
  •  | 
  •  

Question

I am frightened to release my app using this technique to put the database on NSDocumentDirectory. what if I put on an update? will it get removed? users of the app might get really annoyed when the database will get overwritten and clear its contents?

do you think im doing it right?

Was it helpful?

Solution

https://developer.apple.com/library/ios/DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/PerformanceTuning/PerformanceTuning.html

Files Saved During App Updates

When a user downloads an app update, iTunes installs the update in a new app directory. It then moves the user’s data files from the old installation over to the new app directory before deleting the old installation. Files in the following directories are guaranteed to be preserved during the update process:

<Application_Home>/Documents

<Application_Home>/Library

Although files in other user directories may also be moved over, you should not rely on them being present after an update.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top