When scrolling through a UICollectionView, it seems that not everything in cellForItemAtIndexPath
gets called consistently. I'm wondering if it's because the cell gets recycled before the method can complete.
For instance (I'm using the UIImageView category from AFNetworking):
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
THMovieCell* cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
NSNumber* position = [[NSNumber alloc] initWithInteger:indexPath.row + 1];
THMovie* movie = [self.Movies objectForKey:position];
if (movie.ImageUrl) {
[cell.Cover setImageWithURL:movie.ImageUrl];
}
cell.Title.text = movie.Title;
return cell;
}
...however while the cell.Title
UILabel in my custom cell is consistently changed, the image is not.
What's the best way of improving performance for fast scrolling through cells?