【发布时间】:2015-07-27 06:04:01
【问题描述】:
我已经在我的 AppDelegate 中实现了 NSURLCache。
NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:500*1024*1024 diskCapacity:300 * 1024 * 1024 diskPath:nil];
[NSURLCache setSharedURLCache:URLCache];
然后我像这样设置和获取缓存图像
UIImage *cachedImage = [[UIImageView sharedImageCache] cachedImageForRequest:urlRequest];
[[UIImageView sharedImageCache] cacheImage:responseObject forRequest:urlRequest];
但每次我运行应用程序时,所有图像都是从源中获取的。
我在这里做错了吗?
【问题讨论】:
标签: ios afnetworking