Please note, this blog entry is from a previous course. You might want to check out the current one.
Cache photo images viewed by the user into files in your application’s sandbox. Each photo’s image should be a separate file in the sandbox. Limit the cache to about 10MB total. When this limit is reached, the oldest photos in the cache should be evicted (deleted) to make room for new photos coming in. Your application should never query Flickr for the image data for a photo that it has in its cache (obviously). This cache should persist between application launches.
For the caching functionality we create a new class providing three public methods:
+ (FlickrCache *)cacheFor:(NSString *)folder; - (NSURL *)urlForCachedPhoto:(NSDictionary *)photo format:(FlickrPhotoFormat)format; - (void)cacheData:(NSData *)data ofPhoto:(NSDictionary *)photo format:(FlickrPhotoFormat)format;
Continue reading “Assignment #5 Task #3”