Ios UICollectionView如何从解析查询
我有UICollectionView,我需要将图像下载到UIImage单元。我如何使用Parse来完成它?事实上,我需要类解析下载所有图像 这是我的源代码示例:Ios UICollectionView如何从解析查询,ios,parsing,uicollectionview,Ios,Parsing,Uicollectionview,我有UICollectionView,我需要将图像下载到UIImage单元。我如何使用Parse来完成它?事实上,我需要类解析下载所有图像 这是我的源代码示例: - (void)runQuery { PFQuery *query = [PFQuery queryWithClassName:@"SwapPost"]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { // You ob
- (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)集合视图中的节数:
(UICollectionView *)collectionView {
// This is an assumption
return [receivedObject count];
}
(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
self.imageCell.image = [NSArrayName objectAtIndex:indexPath.row];
}
(NSInteger)收藏视图:
(UICollectionView *)collectionView {
// This is an assumption
return [receivedObject count];
}
(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
self.imageCell.image = [NSArrayName objectAtIndex:indexPath.row];
}