1 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
2
3 NSURL *imageURL = [info valueForKey:UIImagePickerControllerReferenceURL];
4 ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset)
5 {
6 ALAssetRepresentation *representation = [myasset defaultRepresentation];
7 NSString *fileName = [representation filename];
8 NSLog(@"fileName : %@",fileName);
9 };
10
11 ALAssetsLibrary* assetslibrary = [[[ALAssetsLibrary alloc] init] autorelease];
12 [assetslibrary assetForURL:imageURL
13 resultBlock:resultblock
14 failureBlock:nil];
15
16 }