Question

I am struggling since few days to make this work. I got the Load More link for loading more thumbnails and when I select the link it loads additional records and datasource is updated accordingly. However it doesn't add additional rows and update Load More link with next page indexes. However additional images are added in existing rows, but wouldn't add new rows with additional images.

Is it something I have to change in photoindex after additional records are added from datasource?

I am loading data from sqlite and I have really large number of records. I was looking into other library just because I can't make this work. :(. I still really want to use this library.

Any help in identifying the problem is really appreciated. Thanks in advance

Was it helpful?

Solution

Error was in PhotoSource method which returns maxPhotoIndex. It has to be in sync with currentPage & number of photos per page.

OTHER TIPS

You should create the subclass of the TTPhotoSource.

Here is my implementation, hope can help you.

@implementation CSCourseListPhotoSource

//return count+1 to display more button
- (NSInteger)numberOfPhotos
{
    return [self items].count + 1;
}

- (NSInteger)maxPhotoIndex
{
    return [self items].count -1;
}

- (id<TTPhoto>)photoAtIndex:(NSInteger)index
{
    if (index < [self items].count) {
        ...
        return photo;
    } else {
        return nil;
    }
}

@end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top