问题
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?
回答1:
Did you set the tableView.dataSource to self? Also, you need to call tableView.reloadData() for populating the datas. Hope this helps.
回答2:
When you use UITableView, dont forget to call self.tableView.reloadData() after downloading data.
来源:https://stackoverflow.com/questions/40289456/why-is-data-not-displayed-when-viewdidload-finished-in-swift