self.tableView.reloadData() not working in Swift

前端 未结 10 1032
离开以前
离开以前 2020-12-23 09:12

I\'m attempting to learn Swift & the basics of iOS dev at the same time, so bear with me. I\'ve got a TableViewController that is

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-23 09:58

    I was also facing the same issue, what I did wrong was that I'd forgot to add

    tableView.delegate = self    
    tableView.dataSource = self
    

    in the viewDidLoad() {} method. This could be one reason of self.tableView.reloadData() not working.

提交回复
热议问题