cwRichardKim / RKSwipeCards

The basics of a swipeable card interface inspired by Tinder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

max buffer method is not working fine

JJJJJJJerk opened this issue · comments

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
    }
}

}

do you mind explaining your problem a little more?