美文网首页iOS开发
iOS12-crash错误-reason: 'UITab

iOS12-crash错误-reason: 'UITab

作者: Lebus | 来源:发表于2019-05-05 16:51 被阅读12次

错误原因:

cellForRowAtIndexPath函数返回了nil

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath)

        // Configure the cell...

        return cell
    }

解决方法:

检查
1.storyboard上有没有给cell加identifier
2.identifier有没有写错
3.函数本身是不是还没实现
4.if else返回其中一个cell时的判断错乱了
5.想到再加

 

广告时间:

小弟有做了两套iOS开发的视频教程,欢迎大家来试听:
https://m.cctalk.com/inst/s9vfhehl

相关文章

网友评论

    本文标题:iOS12-crash错误-reason: 'UITab

    本文链接:https://www.haomeiwen.com/subject/gfmznqtx.html