-5

I Want to create Load More data in uitableview like show an activity indicator at then end and again load more data . i use asihttp request for web service in ios development. so please help me...

Maulik Vekariya
  • 554
  • 7
  • 19

1 Answers1

7

A place to start would be using the UIScrollViewDelegate method, scrollViewDidScroll:, you need to detect when you are at the bottom of the UITableView. By doing this, you can then add your UIActivityIndicatorView, call off to your web service, update your UITableViewDataSource, and reload the table with the additional data.

e.g.

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    if (scrollView.contentOffset.y == scrollView.contentSize.height - scrollView.frame.size.height) {
         // Make new request and add UIActivityIndicator
    }
}

And when your web service returns its data and updates the datasource, you can then call [tableView reloadData] and it will update from your datasource.

Tim
  • 8,932
  • 4
  • 43
  • 64