I am using ELCImagePickerController in my app and I don\'t want to save the selected fullScreenImage to my array because if i selected 40 iPad images then that is not good.
UIImagePickerControllerReferenceURL returns NSURL object not the string object. Please change your code to -
NSData *data = [NSData dataWithContentsOfURL:[dict objectForKey:@"UIImagePickerControllerReferenceURL"]];
NSLog(@"length %d",[data length]);
imageview.image = [UIImage imageWithData:data];
UIImagePickerControllerReferenceURL returns NSURL object for Assets Library, so you can get image as -
ALAssetsLibrary *assetLibrary=[[ALAssetsLibrary alloc] init];
[assetLibrary assetForURL:[[self.imagedata objectAtIndex:i] valueForKey:UIImagePickerControllerReferenceURL] resultBlock:^(ALAsset *asset) {
ALAssetRepresentation *rep = [asset defaultRepresentation];
Byte *buffer = (Byte*)malloc(rep.size);
NSUInteger buffered = [rep getBytes:buffer fromOffset:0.0 length:rep.size error:nil];
NSData *data = [NSData dataWithBytesNoCopy:buffer length:buffered freeWhenDone:YES];//this is NSData may be what you want
[data writeToFile:photoFile atomically:YES];//you can save image later
} failureBlock:^(NSError *err) {
NSLog(@"Error: %@",[err localizedDescription]);
}];
Note: ALAssetsLibrary is deprecated in iOS 9.