ReloadData in performBatchUpdates: completion: does not call cellForItemAtIndexPath:

So, I was playing around mine UITableView

when I noticed this code:

[self performBatchUpdates:^{
    [self reloadData];
} completion:^(BOOL finished) {}];

      

does not result in a call cellForItemAtIndexPath:

, only sizeForItemAtIndexPath

of is UICollectionViewFlowLayout

called.

Does anyone know why this is happening?

I know exactly what is going on in reloadData

, but this is different from this.

+3


source to share


1 answer


From the docs reloadData

: "It should not be called in methods that insert or remove lines, especially in an animation block implemented with calls to beginUpdates and endUpdates." Perhaps this also applies to performBatchUpdates

.



+1


source







All Articles