Retrieving an iPhone photo saved to the photo library

2.9k Views Asked by At

I am saving images to the photo library and would like to retrieve them dynamically to display in future launches of my app. I use the WriteToSavedPhotosAlbum function, as below, but do not get any info to access the saved photo programmatically.

UIImageWriteToSavedPhotosAlbum(UIImage *image, id completionTarget, SEL completionSelector, void *contextInfo);

Once saved, is there a way to retrieve the file name/id and load an image from the photo library at a later time?

3

There are 3 best solutions below

2
On BEST ANSWER

You just need to save them for yourself. Possibly in your app's documents or cache folder.

As a side note, when you say: "display at launch", if you mean to replace the Default.png, that won't work.

The launch image must be static and included in your app bundle.

If not, disregard.

0
On

try this code segment make the necessay changes

UIImagePickerController *picker=[[UIImagePickerController alloc] init];

picker.delegate=pickerDelegate;

picker.sourcetype=UIImagepickerControllerSourceTypePhtoLibrary;

0
On

You can't, unless the user picks the photo using the UIImagePickerController. Check this related question