Please note, this blog entry is from a previous course. You might want to check out the current one.
Add a thumbnail image (FlickrFetcherPhotoFormatSquare) of each spot to every row in any table view that shows a list of spots. In addition …
a. Don’t ask Flickr for the image data of thumbnails that never appear on screen (i.e. fetch thumbnail image data only on demand).
b. Don’t block your main thread waiting for Flickr to give you a thumbnail’s data.
c. Never ask Flickr for the same thumbnail twice (cache the thumbnails’ data in your Core Data database).
To be able to display the thumbnail, we need its URL, which is currently missing in the core data 🙁 … add a new string attribute to the Photo entity, recreate its NSManagedObject subclass and set it in its category:
+ (Photo *)photoWithFlickrInfo:(NSDictionary *)photoDictionary inManagedObjectContext:(NSManagedObjectContext *)context { ... photo.thumbnailURL = [[FlickrFetcher urlForPhoto:photoDictionary format:FlickrPhotoFormatSquare] absoluteString]; ... }
Continue reading “cs193p – Assignment #6 Task #3”