Search code examples
iosimagedirectorydocuments

Providing initial files in /Documents/ folder in an iOS app


Strangely I can't find a lot of information on this.

I am making an application that downloads images, they are downloaded and saved into my apps /Documents/ folder. To avoid an initial huge download I want to ship the app with ~100 images already "downloaded" into the folder.

How can I do this?


Solution

  • They have to go into your Resources bundle. You can then copy them into Documents on first launch. Yes, this means they take twice the space; if you can compress the ones in Resources effectively, I would.

    An ideal answer is to have your loading routine be willing to look in both Documents and your Resources bundle and merge the results. I don't believe any built-in controllers will do this for you, however.