我将如何确定UIImage是否已使用NSURLConnection缓存?
例:
if([NSURLCache containsObject:[UIImage imageNamed@"testPic.png"]]){
NSLog(@"item already cached!");
}
显然上面的代码不起作用,但你明白了......
谢谢!
你必须保存你的请求的副本,然后询问 sharedCache:
- (NSCachedURLResponse *)cachedResponseForRequest:(NSURLRequest *)request
返回的对象包含一堆内容,包括数据对象。