EXC_BAD_ACCESS in heightForRowAtIndexPath iOS

后端 未结 5 1379
眼角桃花
眼角桃花 2020-11-28 14:27

I\'m working on an application where I have a custom subclass of UITableViewCell. I want to make the cell\'s height dynamic based on the text inside it. I try do do that in

5条回答
  •  心在旅途
    2020-11-28 14:52

    tableView heightForRowAtIndexPath is called before cellForRowAtIndexPath, before a cell is displayed, the height needs to be calculated first.

    you should get text from your data source, not from cell

提交回复
热议问题