gmoledina / GMGridView

A performant Grid-View for iOS (iPhone/iPad) that allows sorting of views with gestures (the user can move the items with his finger to sort them) and pinching/rotating/panning gestures allow the user to play with the view and toggle from the cellview to a fullsize display.
MIT License
2.3k stars 512 forks source link

after scrollToObjectAtIndex: atScrollPosition: animated: issue #144

Open ydzheng opened 12 years ago

ydzheng commented 12 years ago

Hi,

First, deep appreciation for sharing this awesome work! It is helping me tremendously in my code.

I found an issue I hope you can help. What I found was that deleting a cell immediately after programmatically move gmGridView to an object by scrollToObjectAtIndex displayed no update of the visible cells in view. Then I tried to modified Demo1ViewController.m code and I saw the same behavior.

Here is what I did: after making the delete button visible by default in each cell, I added the following lines to Demo1ViewController.m / viewWillAppear:

[_gmGridView scrollToObjectAtIndex:20 atScrollPosition:GMGridViewScrollPositionBottom animated:NO];

This causes the A16-A21 cells to show up in view, then after I tapped the delete button in a cell, say A18 and after click @"Delete" in popup alert view, the expected behavior was that A18 should be gone and A22 should move into visible view. However, the view was not updated, i.e. A16-A21 were still shown. By scrolling away and back, I could see that A18 was actually deleted. I saw [gmGridView reloadData] was called.

Thanks for your help,

Cheers

Daniel