Skip to content

Instantly share code, notes, and snippets.

@evanlong
Created February 7, 2011 07:46
Show Gist options
  • Save evanlong/814112 to your computer and use it in GitHub Desktop.
Save evanlong/814112 to your computer and use it in GitHub Desktop.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
...code to dequeue and setup a UITableViewCell removed...
//retrieve our Core Data representation of the photo
Photo* photo = [Photo photoWithFlickrData:pictObj inManagedObjectContext:context];
if (photo.thumbnail) {
cell.imageView.image = [UIImage imageWithData:photo.thumbnail];
}
else {
//Photo objects uses Grand Central Dispatch to make a request to
//Flickr servers for photo downloads.
[photo thumbnailWithBlock:^(NSData* image) {
cell.imageView.image = [UIImage imageWithData:image];
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
}];
}
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment