Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Murat KAYA](https://secure.gravatar.com/avatar/5642e2c77093b52ec026a0bb94aba8b5?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Murat KAYA
10,127 PointsUITableView Pagination JSON
Hi, I have an Json data looks like this.
{
"page": 1,
"results": [
{
"adult": false,
"backdrop_path": "/AsJVim0Hk3KbQPbfjyijfjqmaoZ.jpg",
"id": 194662,
"original_title": "Birdman",
"release_date": "2014-10-17",
"poster_path": "/eOJUEs5cyMFrQuRPQI0glVOVgyo.jpg",
"popularity": 39.4559237723058,
"title": "Birdman",
"video": false,
"vote_average": 7.8,
"vote_count": 570
}
"total_pages": 10667,
"total_results": 213330
}
So I'm trying to make when the user come to the end of the tableview I want to load second page.So What I have to do ?
PS I'am reading first page already. Thanks
![Murat KAYA](https://secure.gravatar.com/avatar/5642e2c77093b52ec026a0bb94aba8b5?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Murat KAYA
10,127 PointsActually I have a tableview and It's look like http://prntscr.com/6cjte2 .So I'm trying to do if user reach the bottom then I want to get next page.Thats What I'am trying.
![Murat KAYA](https://secure.gravatar.com/avatar/5642e2c77093b52ec026a0bb94aba8b5?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Murat KAYA
10,127 PointsActually I used this for detect user is reach the bottom.
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
if (self.tableView.contentOffset.y >= (self.tableView.contentSize.height -self.tableView.bounds.size.height)) {
NSLog(@"bottom");
}
}
But I couldn't implement for loop.Can anybody help me
![Dominic Bryan](https://uploads.teamtreehouse.com/production/profile-photos/1188742/micro_20264613_10214560360582049_2684332637981043167_n.jpg)
Dominic Bryan
14,452 Pointsyes I see what you are doing and in theory it would be as simple as when the scroll view reaches the bottom (of which you currently print the line "bottom") you want to append or extend your current array of information with page 2, then reload the table.
This is semi inefficient in the sense you a reloading all the table so if you got to page 100 you would be reloading 100 pages, but I believe this is the same way some like infintescroll which is a github project works.
![Murat KAYA](https://secure.gravatar.com/avatar/5642e2c77093b52ec026a0bb94aba8b5?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Murat KAYA
10,127 PointsSo How can I use that. I have to get next page.But I don't have an idea how can I do it ?
![Dominic Bryan](https://uploads.teamtreehouse.com/production/profile-photos/1188742/micro_20264613_10214560360582049_2684332637981043167_n.jpg)
Dominic Bryan
14,452 PointsAS I said its hard to do without seeing the code, but just make an IF statement that if the scroll is at the bottom then locate the dictionary that holds page 2 and append/extend to the first page dictionary
That would be my guess, unfortunately I am stuck as far goes as obj-C as I learnt swift first.
Sorry I couldn't be of much help
Dominic Bryan
14,452 PointsDominic Bryan
14,452 Pointsokay I am trying to figure this out but you have a table that displays this information, and you want users who reach the bottom to then find the next page of results, correct?