Skip to content

Instantly share code, notes, and snippets.

@vikdenic
Created August 26, 2014 15:04
Show Gist options
  • Select an option

  • Save vikdenic/3c4b4bc739dc2111e58d to your computer and use it in GitHub Desktop.

Select an option

Save vikdenic/3c4b4bc739dc2111e58d to your computer and use it in GitHub Desktop.
@property NSMutableArray *self.shoeImagesArray;
// ^somewhere within your interface
-(void)retreiveImagesFromParse
{
self.shoeImagesArray = [NSMutableArray new];
PFQuery *query = [PFQuery queryWithClassName:@“Shoe”];
[query findObjectsInBackgroundWithBlock:^(NSArray *shoeObjects, NSError *error)
{
if (!error)
{
for (PFObject *shoeObject in shoeObjects)
{
PFFile *shoeImageFile = [shoeObject objectForKey:@“ShoePhoto”];
[shoeImageFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error)
{
if(!error)
{
UIImage *image = [UIImage imageWithData:data];
self.shoeImagesArray = image;
[self.tableView reloadData];
}
}
}
}
}
}
//Then set your cell’s imageView.image to [self.shoeImagesArray objectAtIndex: indexPath.row]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment