Centurion
Centurion

Reputation: 14304

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?

Upvotes: 13

Views: 2431

Answers (2)

Shanti K
Shanti K

Reputation: 2918

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

Upvotes: 6

KingofBliss
KingofBliss

Reputation: 15115

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

Upvotes: 1

Related Questions