views:

2465

answers:

3

I would like to put some sample images in the applications Documents directory. Can I put these somewhere in my xcode project or do I have to programmatically add them to the Documents folder from the project resources?

Users will be able to add their own images (which will be written to the Documents folder) and I would prefer not to access the sample images separately, I just want them to be pre-seeded in the Documents folder (I'm assuming resources in xcode aren't stored there in the first place?).

+2  A: 

I think you will need to add the images to your app, and then copy them over on the first boot of the app. Just check if they exist (or set a boolean flag in the settings or something) in applicationDidFinishLaunching and create the images you need from there.

Squeegy
+1  A: 

This link might be helpful for you http://www.iphonedevsdk.com/forum/iphone-sdk-development/12014-save-file-directly-into-documents-directory-xcode.html

I also looking answer to that question.

Aler
A: 

I just looked into the same thing. When you put a file in your Resources, it will be part of your app bundle. Which for me is fine, because it's a data file (html). For you, you would have to read it from the bundle, and save it into the document folder when the app runs.

terry franguiadakis