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

Simple case in -updateVisibleGridCellsNow always not called (“Comparison is always false”) #86

Open
coreyfloyd opened this issue Aug 26, 2011 · 0 comments

Comments

@coreyfloyd
Copy link

currentVisibleIndices is created from the range: _visibleIndices. Then immediately compared. It appears as though the comparison should be between newVisibleIndices and _visibleIndices.

Still working through the code, so don't want to make any changes I don't understand yet.

Class AQGridview.m
method: - (void) updateVisibleGridCellsNow;

starting about line: 1563

NSIndexSet * newVisibleIndices = [_gridData indicesOfCellsInRect: [self gridViewVisibleBounds]];

    BOOL enableAnim = [UIView areAnimationsEnabled];
    [UIView setAnimationsEnabled: NO];

    @try
    {
        // a couple of simple tests
        // TODO: if we replace _visibleIndices with an index set, this comparison will have to change
        if ( ([_visibleCells count] != [newVisibleIndices count]) ||
            ([newVisibleIndices countOfIndexesInRange: _visibleIndices] != _visibleIndices.length) )
        {
                        // something has changed. Compute intersections and remove/add cells as required
            NSIndexSet * currentVisibleIndices = [NSIndexSet indexSetWithIndexesInRange: _visibleIndices];

            // index sets for removed and inserted items
            NSMutableIndexSet * removedIndices = nil, * insertedIndices = nil;

            // handle the simple case first
            // TODO: if we replace _visibleIndices with an index set, this comparison will have to change
            if ( [currentVisibleIndices intersectsIndexesInRange: _visibleIndices] == NO )
            {
                removedIndices = [[currentVisibleIndices mutableCopy] autorelease];
                insertedIndices = [[newVisibleIndices mutableCopy] autorelease];
            }
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

1 participant