AQGridView icon indicating copy to clipboard operation
AQGridView copied to clipboard

NSNotFound does not prevent selection in develop branch

Open karmeye opened this issue 12 years ago • 1 comments

Crash with NSRangeException.

Can be fixed by adding i check in _selectItemAtIndex. Do not know if its good solution.

        if (notifiesWillSelect)
            index = [delegate gridView:self willSelectItemAtIndex:index];

        if (notifiesWillSelectMultitouch)
            index = [delegate gridView:self willSelectItemAtIndex:index numFingersTouch:numFingers];

        if (index == NSNotFound)
            return;

        [_selectedIndices addIndex:index];

karmeye avatar Nov 13 '12 14:11 karmeye

Looks like the right fix to me— never trust the user ;o)

On 2012-11-13, at 9:20 AM, rassol [email protected] wrote:

Crash with NSRangeException.

Can be fixed by adding i check in _selectItemAtIndex. Do not know if its good solution.

    if (notifiesWillSelect)
        index = [delegate gridView:self willSelectItemAtIndex:index];

    if (notifiesWillSelectMultitouch)
        index = [delegate gridView:self willSelectItemAtIndex:index numFingersTouch:numFingers];

    if (index == NSNotFound)
        return;

    [_selectedIndices addIndex:index];

— Reply to this email directly or view it on GitHub.

Cheers, -Jim

jimdovey@(mac|gmail).com http://twitter.com/alanQuatermain http://github.com/alanQuatermain http://stackoverflow.com/users/103900/jim-dovey http://ca.linkedin.com/pub/jim-dovey/2/24b/883

AlanQuatermain avatar Nov 13 '12 14:11 AlanQuatermain