I am new to iOS development so my question may be n00bish.I am working on an app for iPad which downloads PDFs and stores on the device(iPad) in the Documents directory so the user can still read them if he isn't connected to WiFi. My question is:if a newer version of the app is available and the user installs it, will it delete all the data(documents,in this case) from the device? If yes,how do I prevent the old data from being deleted? I am using CoreData in this app(if this helps)
Asked
Active
Viewed 198 times
1
-
1Your data in documents folder should remain untact, you could even use it to find out if the previous version of your app was installed or not. But you might find this link interesting: http://stackoverflow.com/questions/5607655/first-app-update-user-data-lost-was-stored-in-documents-directory – Rok Jarc Oct 23 '12 at 02:51
1 Answers
7
When a user installs an updated version of any app, the app's sandbox is kept intact. Only the app and its resource bundle are replaced. So basically, anything you have stored in Documents or Library will be kept intact after the update process. There is no guarantee that files in Library/Caches or tmp will be kept but those should only have transient files anyway.

rmaddy
- 314,917
- 42
- 532
- 579
-
I am confused with this statement "anything you have stored in Documents or Library will be kept **during the update process**" So,if users currently have version 1.0 installed with "doc1","doc2" in the Documents directory and they install version 2.0 later,will they still be able to find "doc1" and "doc2" **after** update?? – user1550951 Oct 23 '12 at 03:04
-
Obviously if you use CoreData for example and your data model has changed then you have to do some coding to make sure the new version can read the old data. Which can be forgotten during testing. – gnasher729 Apr 13 '14 at 11:56