Created
February 7, 2011 07:46
-
-
Save evanlong/814112 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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