The number of items contained in an existing section after the update (1) must be equal to the numbe

原因是数据源有变化的分区没有刷新   Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of items in section 1.  The number of items contained in an existing section after the update (1) must be equal to the number of items contained in that section before the update (0), plus or minus the number of items inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).'

     将局部刷新   [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];

改为整体刷新即可        [self.collectionView reloadData];

猜你喜欢

转载自blog.csdn.net/LIUXIAOXIAOBO/article/details/85339376