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...
Asked
Active
Viewed 1,978 times
-5
-
See http://stackoverflow.com/questions/10404116/uitableview-infinite-scrolling – Aaron Brager Apr 19 '13 at 13:12
-
possible Duplicate of : http://stackoverflow.com/questions/14053143/calling-web-service-on-scrolling-uitableview – Bhavin Apr 19 '13 at 13:55
1 Answers
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
-
1the question may have been down voted to hell but this answer helped me immensely. thanks – BBH1023 Oct 07 '14 at 04:05