Это простой прототип того, что вы можете сделать:
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if ([self.tableData count]>window) {
return window+1;
}
else{
return [self.tableData count];
}
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
if (indexPath.row<window) {
cell.textLabel.text=[self.tableData objectAtIndex:indexPath.row];
}
else{
cell.textLabel.text=@"LoadMore";
}
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.row==window) {
window=window+step;
[tableView reloadData];
}
}
Данные таблицы - это массив, который содержит данные, которые вы хотите отобразить в табличном представлении, окно - это количество строк, которые нужно отобразить изначально, и используется дляустановить диапазон того, что показывать, шаг - количество новых элементов, добавляемых при каждой новой загрузке