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

后端 未结 5 1978
既然无缘
既然无缘 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 19:51

    I had this same exact error because instead of writing

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { ... }
    

    i wrote:

    - (NSInteger)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { ... }
    

    (notice the return value). Hope this helps somebody.

提交回复
热议问题