I am downloading a bunch of image files from a server, and I want to ensure that they are downloaded only if they are newer. This method currently downloads the images just
If your server supports HTTP caching you can specify you want cached content with NSURLRequestReloadRevalidatingCacheData:
NSURLRequest* request = [NSURLRequest requestWithURL:thumbnailURL cachePolicy:NSURLRequestReloadRevalidatingCacheData timeoutInterval:20];
NSURLResponse* response;
NSError* error;
NSData* data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
UIImage* image = [UIImage imageWithData:data];
For more info read the NSURLRequest documentation.