gmoledina/GMGridView — Issue #48: [GMGridView insertObjectAtIndex] wrong assertion
Author: rantav
Created: 2012-02-16 09:10:58+00:00
State: open

Maybe I'm not reading it right, but it seems that insertObjectAtIndex has a wrong assertion at the beginning.

- (void)insertObjectAtIndex:(NSInteger)index
{
NSAssert((index >= 0 && index <= _numberTotalItems), @"Invalid index specified");

When calling insertObjectAtIndex then it's expected that since a new object is inserted, then index is > than _numberTotalItems (the number of total items should increase). That's at least how things work in `UITableViewController`, so I expected similar behavior here as well.
Maybe my expectation is not in place though... what do you think?