I am working with an IOS application in which when i selected an image from IPhone simulator i want to take the URL(url Path) for that image .when i am trying to do it with my below code i get an array of url and not getting the specific string value from that array .Please help me that in which way i am able to retrieve that url for the image only not the array which i am getting with me code.
NSURL *imageURL = [info valueForKey:UIImagePickerControllerReferenceURL];
ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset)
{
ALAssetRepresentation *representation = [myasset defaultRepresentation];
NSString *fileName = [representation filename];
NSLog(@"fileName : %@",fileName);
};
ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init];
[assetslibrary assetForURL:imageURL
resultBlock:resultblock
failureBlock:nil];
NSLog(@"ALAssetsLibrary : %@",assetslibrary);
Please give me the solution that how can i retrieve the url for that image? thanks in advance.