0

I am getting asset URL from NSURL* localUrl = (NSURL *)[info valueForKey:UIImagePickerControllerReferenceURL]; and I saved it in a local database. And at the time of retrieving I have got an string and I have convert it into NSURL through NSURL *url1 = [NSURL URLWithString:image_path]; but when I get NSData from this URL through NSData *myData = [NSData dataWithContentsOfURL:url1]; it return NULL. Can anyone help me to get NSData and convert it into image.

Mil0R3
  • 3,876
  • 4
  • 33
  • 61
Saurabh
  • 423
  • 4
  • 11
  • 22

1 Answers1

1

You can not convert it direct. You will have to use ALAsset Block. Here is the complete description for same thing.

display image from URL retrieved from ALAsset in iPhone

Community
  • 1
  • 1
TheTiger
  • 13,264
  • 3
  • 57
  • 82
  • Thanks for you reply. But I am still getting error this [__NSCFConstantString isFileURL]: unrecognized selector sent to instance 0x3ac5c . The URL of my image is assets-library://asset/asset.JPG?id=83CAC75D-FF0F-44D6-B45C-85BABF32E71B&ext=JPG . – Saurabh Sep 19 '12 at 07:25