Skip to content

Instantly share code, notes, and snippets.

@ivangodfather
Created September 1, 2014 15:59
Show Gist options
  • Select an option

  • Save ivangodfather/d122c506a43ed0376aa8 to your computer and use it in GitHub Desktop.

Select an option

Save ivangodfather/d122c506a43ed0376aa8 to your computer and use it in GitHub Desktop.
[message.image getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
image = [UIImage imageWithData:data];
dispatch_async(dispatch_get_main_queue(), ^{
cell.photoImageView.image = image; //this not
[self.cameraButton setBackgroundImage:image forState:UIControlStateNormal]; //this changes
});
}];
/*!
Asynchronously gets the data from cache if available or fetches its contents
from the Parse servers. Executes the given block.
@param block The block should have the following argument signature: (NSData *result, NSError *error)
*/
- (void)getDataInBackgroundWithBlock:(PFDataResultBlock)block;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment