0
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let row=animals[indexPath.row]
let cellIdentifier = "memoCell"
var cell=tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) as! MemoCellTableViewCell
if cell == nil {
print("cell is nill")
cell = MemoCellTableViewCell(style: .default, reuseIdentifier: cellIdentifier)
}
cell.name?.text="aaa"
cell.address?.text="haha"
return cell
}
添加的TableView到AlertController我具有低于错误。
“无法离队与标识符memoCell细胞 - 必须注册标识的笔尖或类或故事板连接原型细胞”
我不知道为什么。 我设置类的故事板没有错误,也可以设置标识正确
我的代码是在github https://github.com/kotran88/iostableviewTest
请帮我得到这个权利
你尝试'init'了'UITableViewCell'用'style'和'reuseIdentifier',有一个初始化已经存在,只是覆盖它并且称'超级'。 – MEnnabah
这个问题的标题与你在问题中提出的问题无关。这很混乱。 – rmaddy
请不要截图你的代码。把它作为你问题的一部分,就像你对第二部分做的一样。 – the4kman