Search code examples
iphoneobjective-ciosxcodensdocumentdirectory

How to copy a file from Documents Directory to application bundle?


Hi in my app launch i will invoke a web-service call and i will download some zip files now i need to save those files permanently in my application bundle so that when i launch my app for the second time i will just look for update if there is no update i will just use my previously saved files, so i thought to make use of document directory and get the zip file then unzip it and save it in application bundle, here my problem is how to save a file from DocumentsDirectory to my Application Bundle? and does my approach is right & efficient way or do i need to follow some other ways to achieve this? Any help is thankful in advance.


Solution

  • You can't write to your application's bundle - it is readonly, only the documents directory is readwrite.

    You don't need to move the files, as the documents directory provides permanent storage.