Get the name of the chosen image from library using the following code in using Image Picker ViewController

- (void)imagePickerController:(UIImagePickerController *)picker

        didFinishPickingImage:(UIImage *)img

                  editingInfo:(NSDictionary *)editingInfo{

    [picker dismissModalViewControllerAnimated:YES];
    NSURL *imagePath = [editingInfo objectForKey:@"UIImagePickerControllerReferenceURL"];
    NSString *imageName = [imagePath lastPathComponent];
    NSLog(@"image name %@",imageName);

}

Here imageName variable will contains the name of the file chosen.

Categorized in:

IOS,