UITableView 重用cell方法edequeueReusableCellWithIdentifier,出现错误
UITableView 使用重用cell方法edequeueReusableCellWithIdentifier,出現錯誤:
?*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier cell3 - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
解決:
[self.tableView registerClass:[MyTableViewCell class] forCellReuseIdentifier:customCellIdentifier];
或
[self.tableView registerNib:[UINib nibWithNibName:@"MyTableViewCell" bundle:nil] forCellReuseIdentifier:customCellIdentifier];
轉載于:https://blog.51cto.com/nmamtf/1692201
總結
以上是生活随笔為你收集整理的UITableView 重用cell方法edequeueReusableCellWithIdentifier,出现错误的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 将DataTable 数据插入 SQL
- 下一篇: 商业逻辑12讲之人力资源的逻辑