Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why numberOfSectionsInTableView is called twice in UITableViewController?

Is there any other reason (than calling "reloadData") why numberOfSectionsInTableView is called twice? I did debugging and found, that it's get called twice during initial startup when no custom reloadData statements are called.

I have created the table with IB but does that might cause a problem?

like image 815
Centurion Avatar asked Sep 26 '11 12:09

Centurion


2 Answers

Have a look at the call stack. you can see that this method is being called from two different scenarios.

like image 97
Shanti K Avatar answered Nov 15 '22 20:11

Shanti K


Probably your tableView object may instantiate twice. Once i have encountered the same problem due to this.

like image 28
KingofBliss Avatar answered Nov 15 '22 18:11

KingofBliss