Is it possible to delete a file from the main package?

I created a sqlite file and added it to the mainBundle of my Xcode project. This file is copied to the document directory from the main package when the application starts. Is it possible to delete a file from my mainBundle after I copied it to the document directory?

+4
source share
3 answers

In the official application you can not - the application package is read-only.

If you use a jailbroken device and you manage to provide root access to your executable, you can.

+11
source

. , , , iCloud . . -.

+1

, - NSBundle ( ). . it - .

i.e iPhone/iPad, i, e NSCocoaErrorDomain = 513.

What does this mean that when launched on the device, the package has only read permisson, not a record. Therefore, when developing applications, the logic that removes the resource from the NSBundle at run time is not turned on, because it works fine in the iPhone / iPad simulator.

0
source

All Articles