tags:

views:

65

answers:

3

I am developing an application for iphone that will pick an image from photo library and save it at some other place.Now in my application i will be using this image later on from that place.

So can anybody suggest the folder where should i save this image so that the application works perfectly on device also.

+1  A: 

Have a look at this snippet http://snipplr.com/view/28080/save-image-example/, each application has a 'Documents' folder where you could save the image too.

Alistair
A: 

You would save it to the applications document or library folder. If you want the user to have access to it on the iPad, put it in the documents folder. If only code will access it, put it in the library folder.

TechZen
+3  A: 

You want to save it your applications Documents or Library folder. See the Files and Networking Programming Guide and specifically something like:

"Listing 6-1 Getting a file-system path to the application’s Documents/ directory:"

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
calmh
Can someone tell me, why noone usingNSDocumentDirectory() ? instead of example above?
tt.Kilew
@tt.Kilew I can find no such function. Do you have documentation or an example?
calmh
Omg... I was so sure that' I've used this function to resolve Documents directory.... I' even look to documentation to check, and found it!No such function exist, sorry. My bad. Removed my answer.
tt.Kilew
anurag
this worked fine in my app
anurag