Invalid update: invalid number of items on UICollectionView

It’s a bug with using insertItemsAtIndexPaths on an empty UICollectionView. Just do this:

if (self.birthdays.count == 1) {
    [self.collectionView reloadData];
} else {
    [self.collectionView insertItemsAtIndexPaths:@[[NSIndexPath indexPathForItem:   (self.birthdays.count -1) inSection:0]]];
}

(Can’t believe this is still broken in iOS8.)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)