views:

342

answers:

0

I have a UITableView that is loaded from an NSMutableArray. The array is populated by data that I get from a RESTful web service request. In order to speed up the delivery of data to the user, I'm using a couple other NSArrays to hold a cache of the next sets of data.

What I've done is when i'm nearing the end of my current set, in the "tableView:cellForRowAtIndexPath:" method, I take an object from one of my cached arrays and put it in my datasource array.

If I don't call "[table reloadData]" the table never shows the new row. If I do, I run into a loop: A new object is added to the datasource array, reloadData is called, and then we do the same thing over and over and over until we reach the end of the cached array. The visual result is that the table continues scrolling rather quickly to the end of the list unless I interrupt it by scrolling up a bit.

Someone out there has to have tried this before. Does anyone have any pointers? I have seen an example where someone had sets of lists, then added paging functionality to change sets of data in their UITableView. I thought it would be slick to allow for scrolling, though. Does anybody have an idea of the direction I should be going to do this?

Thanks

Ryan