【发布时间】:2017-10-18 09:33:04
【问题描述】:
我的视图控制器中有一个表格视图控制器。当我为行索引方法名称提供静态行数和单元格时,它在表格视图中对我没有任何显示。我也重新加载了表格视图,但它没有显示我不知道为什么会这样,
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return messages.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = UITableViewCell (style: .subtitle, reuseIdentifier: "cellID")
let message = messages[indexPath.row]
cell.textLabel?.text = message.text
return cell
}
【问题讨论】:
-
你有没有为你的tableview设置
delegate & datasource -
你需要设置代理。
标签: ios uitableview swift3