我正在尝试将一些数据添加到UITableView对象.我的问题是我的数据源对象中没有一个方法在运行时被调用.我已经检查过UITableView本身是否显示.当我打电话providerTable.reloadData()只是numberOfSections(in tableView: UITableView) -> Int和tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int方法被调用,但从来没有tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
import UIKit
class ProviderViewController: UIViewController {
let navigationBar = { () -> UINavigationBar in
let bar = UINavigationBar()
bar.setItems([
{ () -> UINavigationItem in
let item = UINavigationItem()
item.title = "a title"
return item
}()
], animated: false)
bar.translatesAutoresizingMaskIntoConstraints = false
return bar
}()
let providerTable = { () -> UITableView in
let providerDataSource …Run Code Online (Sandbox Code Playgroud)