If your tableView:cellForRowAtIndexPath:
method is written correctly using dequeueReusableCellWithIdentifier:
(and you don't use tableView:heightForRowAtIndexPath:
, or it is very fast), UITableView should be able to handle thousands of rows without overloading the device. You just need to be concerned with the storage of your raw data.
As for your problem of not knowing the number of rows until the query is complete, that is easy enough to work around. As you receive more rows from the query, just use UITableView's insertRowsAtIndexPaths:withRowAnimation:
to inform the table view that more rows are available (and be sure that your tableView:numberOfRowsInSection:
and tableView:cellForRowAtIndexPath:
will then reflect these new rows).
If you are also wanting to wait until the user scrolls to the end of the current list before continuing the query, note that UITableView is a subclass of UIScrollView and UITableViewDelegate implements UIScrollViewDelegate. So just use scrollViewDidScroll:
on your UITableViewDelegate to know when the user scrolls and then check the table view's contentOffset
to determine if they've scrolled down far enough that you want to load more data.