How can I delete from NSDocumentDirectory from the device (not from code)?

219 Views Asked by At

There are plenty of answers on how to delete NSDocumentDirectory via code. Unfortunately, that's not what I'm looking for here.

I need a way to delete this from the device. Is there any way short of wiping the entire device and setting it up as a new device?

Deleting the app itself does not delete the NSDocumentDirectory for the application.

1) Will wiping the entire device and setting it up as a new device remove the NSDocumentDirectory?

2) Is there an easier and less costly way than #1 to remove this data off the device, via the device itself?

2

There are 2 best solutions below

0
On

The NSDocumentsDirectory for an iOS application is stored within it's sandbox environment and will be removed when you delete the app from your device.

In iOS 9 you can see the individual storage of each app by going to Settings -> General -> Storage & iCloud Usage -> Manage Storage There is a shortcut here to delete the app.

0
On

Using iTunes, you can delete files from NSDocumentDirectory of app X on your device if app X has activated UIFileSharingEnabled in the Info.plist.

  1. Select your device on iTunes
  2. Click the Apps tab and select your app X in the 'File Sharing' section.
  3. You can delete files or directories.