How to get image from AFNetworking cache offline

I am new to using AFNetworking, my question is that I get one image from the server using AFNetworking and stop the application and start again, but the second time the internet is not available on the device, so I want to get the image from AFNetworking Caching if the internet is not available. on the iPhone. But I do not understand how to do this, I have not used AFNetworking before, so I do not understand how to do it. can anyone help me with some explanation or any good and understated example.

thanks in advance

+3


source to share


1 answer


The cache can be found using cachedImageForRequest in AFImageCache class

If your image is attached to imageView you can use imageView categories method

- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholderImage;

      



in class UIImageView + AFNetworking

Also you can use SDWebImage to manage your images from the web

+1


source







All Articles