문제

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