UITableView crash gives 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [160 nan]'

后端 未结 5 2050
既然无缘
既然无缘 2021-01-31 19:15

I have a custom table view in my app. I have implemented the \"Load More\" feature to the table which loads 25 rows at a time. The problem is after loading 2 times the app crash

5条回答
  •  耶瑟儿~
    2021-01-31 20:08

    The simple answer:

    Returning a NaN from any of the height related delegate methods causes this error.

     tableView:heightForRowAtIndexPath:
     tableView:heightForHeaderInSection:
     tableView:heightForFooterInSection:
    

    etc..

    There may be other ways to produce this error but if you're working with UITableView--check this first!

提交回复
热议问题