Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix insertObjectAtIndex: can not increase old view's tag issue #90

wants to merge 1 commit into


None yet
2 participants

vagase commented May 6, 2012

Move routine out of if scope:

    for (int i = _numberTotalItems - 1; i >= index; i--)
        UIView *oldView = [self cellForItemAtIndex:i];
        oldView.tag = oldView.tag + 1;

Referenced issue:

g-mark commented Jul 18, 2012

I have found that I also need to add this:

if ( index < self.firstPositionLoaded )
    self.firstPositionLoaded = self.firstPositionLoaded + 1;

immediately after the above for loop - otherwise, self.firstPositionLoaded points to a non-loaded cell, and you'll get gaps in the grid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment