In my map application I am calling web srvice which gives total available results in 5km of radius on map when launch. But If results are not available then it calls bigger radius in which I just want to show nearest 2 results in tableview cell. So how to control the loading of tableview data. Because when bigger radius called data count are 100 and I want only 2 results to display out of 100. Can anyone suggest me logic or tutorial. thanks in advance
In my map application I am calling web srvice which gives total available results
Share
If you have searched for the larger radius, return 2 from
numberOfRowsInSectionin yourUITableViewDataSourceotherwise return the count of your array. As long as your array is in the correct order (distance away) then it will only get called twice and so you will only return the nearest 2.Because you are still storing all 100, but only displaying 2, that would mean you could then add a “show more” type button which will show the next 10, for example by returning 12 from
numberOfRowsInSectionand so on.