【发布时间】:2018-01-22 15:32:37
【问题描述】:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = companyTableView.dequeueReusableCell(withIdentifier: "cell")
}
我收到此错误:“从未使用过不可变值 'cell' 的初始化;考虑替换为 '_' 的赋值或删除它。”
我使用“cell”作为 TableViewCell 的标识符。我该如何解决?
【问题讨论】:
-
提到的error是一个警告(黄色)。必须有另一个关于缺少返回值的真正错误(红色)。
-
添加缺少的
return cell可能会有所帮助。
标签: uitableview swift4 xcode9