首页 > UICollectionViewCell 显示问题?

UICollectionViewCell 显示问题?

如图,上传一张照片后刚开始显示正常,向上将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;

}

求助。


这个就是你的cell复用出问题了。regist之后不需要使用alloc - init;绝对会有对象的。
然后就是你这一句没看懂:

cell.upload = self;

这个传值的过程是怎样的?

【热门文章】
【热门文章】