Why is data not displayed when viewDidLoad finishe

2019-03-07 02:00发布

When my application finished being launched, there are supposed to be data displayed on UITableViewCell. However, there is nothing there, so after relaunch the app, by pressing home button and swiping up the view, and select my demo app, all data is shown up properly and there seems like nothing is wrong. What causes the initial problem? Do you have any ideas why?

2条回答
▲ chillily
2楼-- · 2019-03-07 02:29

Did you set the tableView.dataSource to self? Also, you need to call tableView.reloadData() for populating the datas. Hope this helps.

查看更多
别忘想泡老子
3楼-- · 2019-03-07 02:49

When you use UITableView, dont forget to call self.tableView.reloadData() after downloading data.

查看更多
登录 后发表回答