I'm trying to make some custom feed with posts of image and titles and currently I'm doing it for mobile. I'm using PHP for webservice.

When using pagination how do you download posts from web? Do you send some page parameter to webservice or is there some other way?

So something like this:

http://www.mywebpage.com/?command=stream&page=0

and then just increment page that is private variable in-app and autoincremented before every new request? Or this is done in a different way?

Thanks.

有帮助吗?

解决方案

Yes you are on the right track. The usual practice is to send a currentOffset, or a page number parameter (if your entries per page is constant).

I am assuming you want to display the feed in a UITableView, and lazy-load more entries (the next page of entries) when the user scrolls to the bottom of the list. You can implement the pagination logic yourself by implementing scrollViewDidScroll: to detect that you have hit the bottom of the list, but I find NMPaginator particularly helpful for this purpose.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top