I have a table view with one section. I pull the data down from the internet in small chunks asynchronously in the background. The problem I have is I don't know how many records there will be in total. When the web service stops returning data I know I have them all, in some cases the rows might be infinite.
The method:
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
is understandably called once at the beginning of view load, at this point I don't know how big my section is going to be. Any ideas on how best to approach this problem? Can I set the section size anywhere after this method has been called?
You can make the tableview reload it's data, call
[tableView reloadData];
...and it will ask the datasource about number of rows etc again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With