如何将URL图像存储在缓存中,然后在iphone中的imageview中显示 [英] how to store url image in cache memory then display in imageview in iphone
问题描述
我在Imageview中直接打开URL图像,但我想将图像存储在缓存中以备将来参考...帮我解决我的问题..
I directly open URL image in Imageview but i want to store the images in cache memory for future reference... help me to solve my problem..
谢谢提前
推荐答案
您可以使用 SDWebImage ...
此库提供 UIImageVIew
的类别支持来自网络的远程图像。
This library provides a category for UIImageVIew
with support for remote images coming from the web.
它提供:
一个 UIImageView
将Web图像和缓存管理添加到Cocoa Touch框架的类别
An UIImageView
category adding web image and cache management to the Cocoa Touch framework
异步图像下载
具有自动缓存到期处理的异步内存+磁盘映像缓存
An asynchronous memory + disk image caching with automatic cache expiration handling
背景图像解压缩
保证不会多次下载相同的URL
A guarantee that the same URL won't be downloaded several times
保证不会一次又一次地重试伪造的URL
A guarantee that bogus URLs won't be retried again and again
保证主线程永远不会被阻止
A guarantee that main thread will never be blocked
表现!
使用GCD和ARC
Performances! Use GCD and ARC
这篇关于如何将URL图像存储在缓存中,然后在iphone中的imageview中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!