如图,上传一张照片后刚开始显示正常,向上将cell划出屏幕上传好的图片就变到第二个item里了。
上滑屏幕
部分代码:
注册:
[self.pictureCollection registerNib:[UINib nibWithNibName:@"CAPictureCell" bundle:[NSBundle mainBundle]]forCellWithReuseIdentifier:@"capicture"];
代理方法:
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
CAPictureCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"capicture" forIndexPath:indexPath];
cell.upload = self;
cell.indexPath = indexPath;
return cell;
}
求助。
This is a problem with your cell reuse. There is no need to use alloc - init after register; there will definitely be objects.
Then you didn’t understand this sentence:
What is the process of passing values?