Created
August 26, 2014 15:04
-
-
Save vikdenic/3c4b4bc739dc2111e58d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| @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