Reputation: 631
I have created a sqlite file and added it into the mainBundle of my Xcode project. This file gets copied to document directory from main bundle on app launch. Is there a possibility to remove the file from my mainBundle after i copied it to the document directory ?
Upvotes: 4
Views: 1491
Reputation: 31
Is is impossible. What's more, if you copy too much data from main bundle to document directory, you may be rejected by app store because iCloud will backup the data in document directory. I have ever been rejected for this reason. You can copy the data to cached directory instead.
Upvotes: 1
Reputation: 1702
Basically in an app you developed a logic that on run time you need to delete some resource from NSBundle time(which is through coding).As initailly the application is run on simulator by most developers.it will work perfectly with no issue.
But when you run the same application on device i.e iPhone/iPad it will show a error i,e NSCocoaErrorDomain = 513.
What it means is that on runtime in device the bundle has only read permisson not write. So when designing the applications do not include logic that deletes the resource from NSBundle on run time because it will work perfectly in iPhone/iPad simulator.
Upvotes: 0
Reputation:
From within an official application, you can't - the app bundle is read-only.
If you are running on a jailbroken device and you manage to give root access to your executable, then you can.
Upvotes: 12