Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash while dragging cells #1

Closed
smithani opened this issue May 10, 2010 · 3 comments
Closed

crash while dragging cells #1

smithani opened this issue May 10, 2010 · 3 comments

Comments

@smithani
Copy link

I'm experimenting with the code provided and it is really useful; however, I found that the sample (springboard) code crashes, if you reduce the number of icons down to 19, then try to move to an empty spot.

@AlanQuatermain
Copy link
Owner

Yeah, a friend at Apple found that too— it crashes in the sample when you drag down to the bottom (i.e. out of the actual allocated range). I think it's a simple fix: never try to move the empty cell placeholder beyond the bounds of the available cell list, i.e. MAX(attemptedCellIndex, numberOfCells-1).

I'll try to put a fix together for that today.

@smithani
Copy link
Author

Thanks!

@AlanQuatermain
Copy link
Owner

Fixed at this commit.

AQGridViewData now returns NSNotFound when asked for a cell index based on a point which doesn't correspond to a real cell. The SpringBoard application now observes this return value and uses the index of the last cell in the list instead, which matches the behaviour of Apple's springboard. The same thing happens now if you drag a cell off the edge of the screen.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants