Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is -[UITableView reloadData] asynchronous or synchronous?

When you call -reloadData on a table view instance, does it make all UITableViewDataSource calls async? Thank you.

like image 828
the Reverend Avatar asked Mar 12 '12 22:03

the Reverend


1 Answers

This method actually just removes all the UITableViewCell views from the table. The data source delegate methods are called when the table is repainted.

So, it's asynchronous.

Edit:

Actually, some calls ARE synchronous. The number of sections & rows and row heights are updated immediately, so, for example contentSize is set correctly after the call. On the other hand, tableView:cellForRowAtIndex: is not called until the table is repainted.

like image 93
Sulthan Avatar answered Nov 16 '22 00:11

Sulthan