[Assertion failure in -[UISectionRowData refreshWithSection:tableView:tableViewRowData:], /Source]

博客園地址:http://www.cnblogs.com/HMJ-29/p/7573921.html
1、
******* Assertion failure in -[UISectionRowData refreshWithSection:tableView:tableViewRowData:], /SourceCache/UIKit_Sim/UIKit-3600/UITableViewRowData.m:485

本人遇到此問題是因?yàn)闉榱诉m配 iOS11 增加的代碼,也在其他 iOS 版本中添加而造成的,只要做下面處理即可:

if #available(iOS 11.0, *) { 
  //適配iOS11的代碼
}

2、
***** Assertion failure in -[UISectionRowData refreshWithSection:tableView:tableViewRowData:], /SourceCache/UIKit_Sim/UIKit-3318.16.14/UITableViewRowData.m:619

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'table view row height must not be negative - provided height for index path (<UIMutableIndexPath 0x7fc9a368f0b0> 2 indexes [0, 0]) is nan'

報錯原因是 在tableview的heightForRow方法里返回的數(shù)據(jù)錯誤,返回的數(shù)據(jù)是nan型的,為什么是nan呢,猜測可能是數(shù)據(jù)越界,你可能得到到的是double類型,而heightforrow需要的是CGFloat類型

解決方法:
在height for row方法里 做出判斷,如果height == nan 就設(shè)置默認(rèn)高度

第二個問題本人并沒有遇到,在找尋答案時發(fā)現(xiàn)有人遇到過上面問題就集中放一起。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容