0

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.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Roshi
  • 41
  • 7
  • Can you please elaborate you question? I did not understood where you are getting an array and where you are trying to access image url. – Naga Mallesh Maddali May 05 '14 at 05:17
  • when i print imageURL it gives me the value like : imagepath : ( "assets-library://asset/asset.JPG?id=36BF5BC0-09A7-4F77-837D-460BD7DF2580&ext=JPG" ) this is an array,but i want only string value so that when i upload this image with the incoming url i could upload it. if u know the way plz let me know thank you!! – Roshi May 05 '14 at 05:36
  • plz check this post http://stackoverflow.com/questions/10799605/how-to-get-the-data-from-uiimagepickercontrollerreferenceurl-ios-sdk – Naga Mallesh Maddali May 05 '14 at 05:53

0 Answers0