【发布时间】:2014-06-03 05:01:22
【问题描述】:
在 DetailView 中,我试图从 Parse.com 后端显示超过 1 张图像,所以我有以下代码:
编辑:
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"Cell";
VestimentaDetailCell *cell = (VestimentaDetailCell *) [collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath];
static int index = 1;
PFFile *imageFile = [self.vestimenta objectForKey:[NSString stringWithFormat:@"image_%d", index ]];
[imageFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
if (!error) {
cell.imageFile.image = [UIImage imageWithData:data];
}
}];
return cell;
}
它有效.. 问题是一旦用户查看了图像,一旦它们不再出现。
所以我尝试实现:
PFFile *imageFile = [self.vestimenta objectForKey:[NSString stringWithFormat:@"image_%d"]];
但随后我收到“更多 '%' 转换比数据参数。 如何设置代码?
【问题讨论】:
标签: ios image uicollectionview parse-platform