0

I use the UIImagePickerController to take photo or to select it from an album. Here I put the selected image to the imageView :

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

    UIImage *chosenImage = info[UIImagePickerControllerEditedImage];
    self.temporaryImageView.image = chosenImage;
    [picker dismissViewControllerAnimated:YES completion:NULL];
}

But How can i get the address of the selected photo on the device? or the name of it? Is it possible?

mikezs
  • 410
  • 1
  • 8
  • 16

1 Answers1

0

May be this can help you;

NSMutableString *imageName = [[[NSMutableString alloc] initWithCapacity:0]];

CFUUIDRef ref = CFUUIDCreate(kCFAllocatorDefault);
if (ref) {
    [imageName appendString:NSMakeCollectable(CFUUIDCreateString(kCFAllocatorDefault, theUUID))];
}
[imageName appendString:@".png"];

I also recommend you to check this answer; https://stackoverflow.com/a/16184616/2622013

Community
  • 1
  • 1
Göktuğ Aral
  • 1,409
  • 1
  • 13
  • 28