Browse files

Bug fix: Unused cells are not removed from the scrollview and may app…

…ear unexpectedly
  • Loading branch information...
1 parent 0cfda25 commit 23eecfd2cbb12e63a3a5a48d65fd0e0de19e08dc @berzniz berzniz committed Jul 22, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 NGVaryingGridView/NGVaryingGridView/NGVaryingGridView.m
View
1 NGVaryingGridView/NGVaryingGridView/NGVaryingGridView.m
@@ -197,6 +197,7 @@ - (void)loadCellsInRect:(CGRect)rect {
// Move unused Cells to reusableCells
NSMutableDictionary *unusedCells = [NSMutableDictionary dictionaryWithDictionary:self.gridCells];
[unusedCells removeObjectsForKeys:usedCells.allKeys];
+ [unusedCells.allValues makeObjectsPerformSelector:@selector(removeFromSuperview)];
[self.gridCells removeObjectsForKeys:unusedCells.allKeys];
[self.reuseableCells addObjectsFromArray:unusedCells.allValues];

0 comments on commit 23eecfd

Please sign in to comment.