I need implement some kind of lazy loading in my UITableView.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
//... some initializations here
//this is a function that pulls my cell data using helper class
NSData *cellData=[MyDataClass dataForCellAtIndexPath:indexpath.row];
//... here I populate pulled data to cell
return cell;
}
Everything works great, but table view scrolls not smoothly, because dataForCellAtIndexPath
method is slow. So I need to implement lazy populating data into cells by calling this method. The result I expect is that table view will scroll smoothly but cell's content will populate a bit after the cell is drawn. Help me please, How can it be done?