美文网首页
Bugly报错:section footer height mu

Bugly报错:section footer height mu

作者: 笙绳省盛 | 来源:发表于2018-10-31 13:43 被阅读27次
今天遇到一个线上错误,bugly上报的错误是section footer height must not be negative - provided height for section 0 is -0.000100。 屏幕快照 2018-10-31 下午1.31.45.png

可是我一看自己写的明明是0.0001,不是0呀。然后自己根据报错的追踪界面试了下也没产生相同的崩溃。然后搜索了网上资料发现有说是因为用了func tableView(_ tableView: UITableView, estimatedHeightForFooterInSection section: Int) -> CGFloat方法。然后到自己代码里一看确实那个界面用了这个方法,而其他界面用的都是func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat。
但是为什么我的手机是好的呢?我猜测是不是iOS系统的问题,用户用的是iOS9.3.3的系统,我用的是iOS12系统。我用Xcode9.3模拟器运行了,果然崩溃了。
经过测试我发现,当iOS9或iOS8系统下使用func tableView(_ tableView: UITableView, estimatedHeightForFooterInSection section: Int) -> CGFloat,如果return 值小于1会产生崩溃,iOS11和12则不会。
记录下这个小bug,也怪自己测试不够全面。

相关文章

网友评论

      本文标题:Bugly报错:section footer height mu

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