cwRichardKim / RKSwipeCards

The basics of a swipeable card interface inspired by Tinder
MIT License
2.17k stars 61 forks source link

max buffer method is not working fine #14

Closed JJJJJJJerk closed 7 years ago

JJJJJJJerk commented 9 years ago

i have 754 web images to display

-(void)loadCards { if([self.shows count] > 0) { NSInteger numLoadedCardsCap =(([self.shows count] > MAX_BUFFER_SIZE)?MAX_BUFFER_SIZE:[self.shows count]); for (int i = 0; i<[self.shows count]; i++) { DraggableView* newCard = [self createDraggableViewWithDataAtIndex:i]; [allCards addObject:newCard];

        if (i <numLoadedCardsCap) {
            [loadedCards addObject:newCard];
        }
    }

    //%%% displays the small number of loaded cards dictated by MAX_BUFFER_SIZE so that not all the cards
    // are showing at once and clogging a ton of data
    for (int i = 0; i<[loadedCards count]; i++) {
        if (i>0) {
            [[loadedCards objectAtIndex:i]loadPosterImage];

            [self insertSubview:[loadedCards objectAtIndex:i] belowSubview:[loadedCards objectAtIndex:i-1]];
        } else {
            [self addSubview:[loadedCards objectAtIndex:i]];
        }
        cardsLoadedIndex++; //%%% we loaded a card into loaded cards, so we have to increment
    }
}

}

cwRichardKim commented 9 years ago

do you mind explaining your problem a little more?