I have a UITableView whose cells contain custom ImageViews that asynchronously load the images from the internet. To load those images I use NSURLRequest and NSURLConnection which works fine. The only problem is that the images are not cached and therefore are downloaded every time they are used. I tried to set the cachePolicy of the NSURLRequest to "NSURLRequestReturnCacheDataElseLoad" with no effect.
It seems from the last answer on link that disk caching is not supported with NSURLRequest on the iPhone. Is this correct?
If it should actually work, I'd be interested to know what could be the reason that it doesn't work in my case.
Here's the code:
NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://myurl"] cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:60.0];
connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];