Search code examples
objective-cuiimagepickercontrollerphoto

Get Image name from photo Library


I m trying to implement UIImagePicker in my application. Now i m retrieving the image from the photo library. Is there any way in which i can retrieve the name of the image from photo library ? tried UIImagePicker methods but cant find one. Any one.. ? Thanks..


Solution

  • In the delegate method of UIImagePickerController called

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

    you can use the info dictionary to get the reference url of the image that the user picked by using key UIImagePickerControllerReferenceURL and get the file name from it.