Calling web service on Scrolling UITableView
Totally Confused !!!...
I have one web-service that accepts the pageNumber as Parameter and gives me some records as JSON response. (This service basically implements the functionality of Paging for Silverlight version.) I want to load these pages one by one when user scrolls the UITableView (means Load the next 20 entries (or second page) when user scrolls).
My Problem :
How and Where to call this service and How to calculate pageNumber ?
I searched about this but didn't get any Satisfied answer.
What I found is :
- How to call web service after each certain number of data received and load it into table view
- Load more data from a web service when the user scrolls the UITableView
- how to add elements to tableview on scrolling iphone?
I would love to here your responses in Objective-C Language.
Any Suggestions ?
Take one integer set it to 0. Now Used Pull to refresh functionality (Pull To refresh exmaple).
Now in API side you have to set the two extra parameter like pagenumber and pageSize
At very first time you call API with pageNumber=0 and pageSize=20
Now when you pull the table then you have a particular method in which you have to call the API with pageNumber++ and pageSize=20 again and whatever you get in the response add into your NSMutableArray. If you found nothing then remove pull to refresh option