【问题标题】:Error: definition conflict with previous value错误:定义与之前的值冲突
【发布时间】:2016-06-28 18:34:41
【问题描述】:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

    let cell = tableView.dequeueReusableCellWithIdentifier("nameCell", forIndexPath: indexPath)
    let pancakeHouse = pancakeHouses[indexPath.row]
    if let cell = cell as? FAQsViewCell {
        cell.pancakeHouse = pancakeHouse
    } else {
        cell.textLabel?.text = pancakeHouse.que
    }


    return cell
}

我在运行我的项目时遇到了UITableViewController这个功能的错误,当时我得到它我无法理解它为什么会出现或它的含义。

【问题讨论】:

  • 错误出现在哪一行?
  • 您能提供更多信息吗?
  • 现在解决了,谢谢

标签: ios swift


【解决方案1】:

当您忘记设置单元格标识符

时,也会发生“定义与先前值冲突”

确保您为自定义单元格设置了正确的标识符(在您的情况下为“nameCell”):

【讨论】:

  • 非常感谢我添加了标识符,但我认为它保存得不好,这就是为什么我得到了这个错误,现在它解决了
猜你喜欢
  • 2017-11-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-06-12
  • 1970-01-01
  • 2012-10-26
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多