I'm using this code when downloading images in one of my current projects and it's not working with AFNetworking 2.0. I tried going thru AFImageResponseSerializer but I can't find the right code to use.
[cell.posterImage setImageWithURLRequest:urlRequest placeholderImage:[UIImage imageNamed:@"placeholder.png"] success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
cell.posterImage.image = image;
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) {
NSLog(@"Request failed with error: %@", error);
}];
Any suggestions on the new code used in AFNetworking 2.0? Thanks!
I made it work using this code:
But I got into another problem with placeholder images using this. Any ideas?
https://github.com/AFNetworking/AFNetworking/archive/master.zip is including UIKit+AFNetworking directory
With the updated
AFNetworking 2.0
(in case your files are accessible for download-only basis, so are not accessible by a simple URL) :Hope it helps.
You're looking for
UIImageView (AFNetworking)
category.cell.posterImage
must be anUIImageView
not anUIImage
.