Delete the Documents path of the app

Delete the Documents path of the app

Will the files or folders in the documentDirectory path or applicationSupportDirectory path disappear or be deleted when the OS is updated?

I know that sometimes all the files in the cachesDirectory path are deleted when the OS is updated or the device is rebooted.

Sometimes, users of my app report that all the files in the documentDirectory path or applicationSupportDirectory path are deleted or disappear, or all the files are deleted and initialized.

I thought that the files or folders in the documentDirectory path or applicationSupportDirectory path were not affected by the OS update, but am I wrong?

Answered by ForumsContributor in
Will the files or folders in the documentDirectory path or applicationSupportDirectory path disappear or be deleted when the OS is updated?

No.

Well, that’s not supposed to happen. There’s always the possibility of bugs. However, if this were a common occurrence then there’d be a lot of user complaints.

I do sometimes see this happen due to bugs in the app. For example, let’s say an app stores its documents in the Documents directory but keeps an index of them in a separate file. If that index uses absolute paths to refer to the documents, then a change to the app’s container’s path will make it seems like all the documents have disappeared.

My advice is that you try to engage with a user whose affected by this issue to see if you can learn more about what’s actually gone wrong. For example, you could send them a special TestFlight build of your app that can export a low-level report of what’s actually in the app’s container.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Delete the Documents path of the app
 
 
Q