【发布时间】:2017-04-29 02:14:34
【问题描述】:
不断收到此错误:
'源文件中的编辑器占位符'
在线tableView.dequeueReusableCell,不知道出了什么问题。请帮助如何摆脱这个错误。函数原型由 Xcode 建议。无法像某些人建议的那样删除tableView.dequeueReusableCell 中的withIdentifier 以解决此问题。
func tableView(_ tableView:UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "BasicCell", for: IndexPath)
cell.textLabel?.text = filters[indexPath.row]
return cell
}
【问题讨论】:
-
indexPath(小写)。 -
IndexPath在函数调用中仍然使用占位符值(注意背景突出显示)。您需要将其替换为indexPath