0
我有UICollectionView,我需要下載圖像到UIImage單元格。我怎樣才能用Parse來做到這一點?事實是,我需要Parse類下載所有圖像。UICollectionView如何從解析查詢
這是我的源代碼示例:
- (void)runQuery {
PFQuery *query = [PFQuery queryWithClassName:@"SwapPost"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
// You obviously need better error handling in here...
self.myImage = objects;
[self.myCollectionView reloadData];
}
];
}
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
// This is an assumption
return 1;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.myImage.count;
}