2016-09-30 1 views
0

로그인 : 두 부하 XRKPosterCell-0 다른UICollectionView dequeueReusableCellWithReuseIdentifier : forIndexPath : 잘못된 indexPath 재사용 전지 방법

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 

1 loadData

2016-09-30 15:55:28.764 MYAPP[12950:384498] PosterCell-0: <PosterCell: 0x7fdd3c57cf90> 

2016-09-30 15:55:28.782 MYAPP[12950:384498] PosterCell-1: <PosterCell: 0x7fdd3c4cc0c0> 

2016-09-30 15:55:28.807 MYAPP[12950:384498] PosterCell-2: <PosterCell: 0x7fdd3c5815e0> 

2016-09-30 15:55:28.959 MYAPP[12950:384498] PosterCell-0: <PosterCell: 0x7fdd3c5815e0> 

2016-09-30 15:55:28.961 MYAPP[12950:384498] PosterCell-1: <PosterCell: 0x7fdd3c57cf90> 

2016-09-30 15:55:28.962 MYAPP[12950:384498] PosterCell-2: <PosterCell: 0x7fdd3c4cc0c0> 

당신은 볼 2 reloadData. 왜?

+0

컬렉션보기에 사용 된 모든 대리자 방법을 표시 할 수 있습니까? –

답변

1

dequeueResuableCell을 사용하여 만든 셀을 다시 사용하고 있기 때문에 문제가 발생합니다.

당신은

postercell-0 in reload1 = postercell1 in reload2 
PosterCell-1 in reload1 = PosterCell-2 in reload2 
PosterCell-2 in reload1 = PosterCell-0 in reload2. 

이 세포를 바로 재사용되고 있음을 관찰 할 수있다 ... 너무 다른 세포에 대한 재 장전 2 리로드 1 비교!

+0

알고 있습니다. 왜 postercell-0 reload1 = PosterCell-0 reload2 – weiminghuaa

+0

잘못된 reuser 원인 imageView 깜박임 화면 – weiminghuaa