Please note, this blog entry is from a previous course. You might want to check out the current one.
Teach yourself how to use NSFileManager and use it along with NSData’s writeToURL:atomically: method to cache image data from Flickr (the photos themselves) into files in your application’s sandbox (you’ll probably want to use the NSCachesDirectory to store them). Maybe you keep the last 20 photos the user looks at or all the photos in Recents or maybe 50MB’s worth of photos? Up to you.
Create a new class with two public class methods. One will cache provided data for a given URL. The other one will return the cached image, if possible.
+ (void)cacheImageData:(NSData *)data forURL:(NSURL *)url; + (UIImage *)cachedImageForURL:(NSURL *)url;
Continue reading “cs193p – Assignment #6 Extra Task #4”













