Xcode error: unable to dequeue a cell with identifier cell
2017-08-11 13:46
1471 查看
Xcode error: unable to dequeue a cell with identifier cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard
用纯代码写tableview出现以上错误,错误是以下代码触发的。刚开始虽然知道是indentifier的问题,但不知道怎么解决。
let CellIdentifier = "CellIdentifier"
let cell:CustomTableViewCell! = tableView.dequeueReusableCell(withIdentifier: CellIdentifier, for: indexPath) as? CustomTableViewCell
后面百度了,原来我那个CellIdentifier还没注册。解决问题途径是在初始化tableview的地方加上以下代码:
table.register(UITableViewCell.self ,forCellReuseIdentifier: "CellIdentifier")
用纯代码写tableview出现以上错误,错误是以下代码触发的。刚开始虽然知道是indentifier的问题,但不知道怎么解决。
let CellIdentifier = "CellIdentifier"
let cell:CustomTableViewCell! = tableView.dequeueReusableCell(withIdentifier: CellIdentifier, for: indexPath) as? CustomTableViewCell
后面百度了,原来我那个CellIdentifier还没注册。解决问题途径是在初始化tableview的地方加上以下代码:
table.register(UITableViewCell.self ,forCellReuseIdentifier: "CellIdentifier")
相关文章推荐
- 哈02—kill error_______unable to dequeue a cell with identifier Cell
- unable to dequeue a cell with identifier shopCell
- TableView unable to dequeue a cell with identifier Cell - must register a class or Nib
- Xcode unable to dequeue a cell with identifier
- UITableView 的一个常见错误'unable to dequeue a cell with identifier Cell - must register a nib or a class f
- UITableViewCell unable to dequeue a cell with identifier Cell - must register a nib or a class for t
- swift写一个简单的列表unable to dequeue a cell with identifier reuseIdentifier - must register a nib or a cla
- UITableViewCell unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell
- unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
- unable to dequeue a cell with identifier xxx - must register a nib or a class for the identifier
- unable to dequeue a cell with identifier cell - must register a nib or a class for the identifier or
- unable to dequeue a cell with identifier xxx - must register a nib or a class fo
- unable to dequeue a cell with identifier - must register a nib or a class for the identifier...问题
- unable to dequeue a cell with identifier Identify - must register a nib or a class for the identifie
- UITableView使用注意事项(unable to dequeue a cell with identifier)
- iOS 如何解决'could not dequeue a view of kind: UICollectionElementKindCell with identifier cell
- reason: 'could not dequeue a view of kind: UICollectionElementKindCell with identifier cellIdentifie
- When to use dequeueReusableCellWithIdentifier vs dequeueReusableCellWithIdentifier: forIndexPath
- IOS 使用storyboard,自定义TableViewCell的坑,dequeueReusableCellWithIdentifier 报错
- dequeueReusableCellWithIdentifier的运行机制