estimatedHeight 返回高度小于等于1导致的崩溃(Error:table view row height must not be negative)

在estimatedHeightForRowAtIndexPath方法中,实测如果返回高度小于等于1,会导致程序崩溃。错误原因:table view row height must not be negative,建议返回高度做大于1的保护,不知道苹果官方啥时候会修这个问题。
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath { return 1.01; }
具体可见UITableView crash after i implemented estimatedHeightForRowAt indexPath`?

你可能感兴趣的:(iOS开发)