Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here I've my own approach which i found out just before coneybeare's answer. I simply subclassed TTTableMoreButton and TTTableMoreButtonCell classes and in the "- (void)layoutSubviews" method, I detect that "Load More" button is appearing, and it should start loading more data if it is not already doing it.</p> <p>I'm not sure which approach (coneybeaare's or mine) is the best and I'm looking forward for the comments about it.</p> <p>AutoMoreTableItem.h </p> <pre><code>@interface AutoMoreTableItem : TTTableMoreButton { } @end </code></pre> <p>AutoMoreTableItem.m</p> <pre><code>#import "AutoMoreTableItem.h" @implementation AutoMoreTableItem @end </code></pre> <p>AutoMoreTableItemCell.h</p> <pre><code>@interface AutoMoreTableItemCell : TTTableMoreButtonCell { } @end </code></pre> <p>AutoMoreTableItemCell.m</p> <pre><code>#import "AutoMoreTableItemCell.h" #import "AutoMoreTableItem.h" @implementation AutoMoreTableItemCell - (void)setObject:(id)object { if (_item != object) { [super setObject:object]; AutoMoreTableItem* item = object; self.animating = item.isLoading; self.textLabel.textColor = TTSTYLEVAR(moreLinkTextColor); self.selectionStyle = TTSTYLEVAR(tableSelectionStyle); self.accessoryType = UITableViewCellAccessoryNone; } } - (void)layoutSubviews { [super layoutSubviews]; AutoMoreTableItem* moreLink = self.object; if(moreLink.isLoading ==YES) { return; } if (moreLink.model) { moreLink.isLoading = YES; self.animating = YES; [moreLink.model load:TTURLRequestCachePolicyDefault more:YES]; } } @end </code></pre> <p>And of course, in the datasource implementation:</p> <pre><code>- (Class)tableView:(UITableView*)tableView cellClassForObject:(id) object { if([object isKindOfClass:[AutoMoreTableItem class]]){ return [AutoMoreTableItemCell class]; } else { return [super tableView:tableView cellClassForObject:object]; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload