【Thread 1: signal SIGABRT】:UITableView、UICollectionView自定义Cell单元格之前,必须注册Cell

★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
➤微信公众号:山青咏芝(shanqingyongzhi)
➤博客园地址:山青咏芝(https://www.cnblogs.com/strengthen/
➤GitHub地址:https://github.com/strengthen/LeetCode
➤原文地址:https://www.cnblogs.com/strengthen/p/12141815.html
➤如果链接不是山青咏芝的博客园地址,则可能是爬取作者的文章。
➤原文已修改更新!强烈建议点击原文地址阅读!支持作者!支持原创!
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★

错误提示:

Thread 1: signal SIGABRT

CustomCell是自定义的UITableViewCell或UICollectionViewCell

在复用单元格之前必须注册Cell。

UITableView注册Cell

collectionView.register(CustomCell.self,forCellWithReuseIdentifier:cellIdentifier)

UICollectionView注册Cell

tableView.register(CustomCell.self,forCellReuseIdentifier:cellIdentifier)

之后才可以编写复用代码!

猜你喜欢

转载自www.cnblogs.com/strengthen/p/12141815.html