1

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?

Arrel
  • 13,558
  • 7
  • 26
  • 24

3 Answers3

2

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

Community
  • 1
  • 1
Marco Mustapic
  • 3,879
  • 1
  • 21
  • 20
2

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.

Corey Floyd
  • 25,929
  • 31
  • 126
  • 154
  • That's what I was afraid of. By "display at launch" I just meant load one of them in the initial view on display. – Arrel Jul 01 '09 at 15:59
  • Default.png can be a symbolic link to something outside the bundle, though. http://collison.ie/blog/2008/11/dynamic-defaultpng-files-on-the-iphone – Josh Lee Nov 13 '09 at 13:58
0

try this code segment make the necessay changes

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

picker.delegate=pickerDelegate;

picker.sourcetype=UIImagepickerControllerSourceTypePhtoLibrary;

Ankit Sachan
  • 7,690
  • 16
  • 63
  • 98