如何从故事板返回自定义单元格高度?

早些时候,我问了一个关于如何隐藏静态单元格的问题 。

我得到的最好的答案隐藏单元格,但它然后将其他单元格高度设置为44

我想find一个方法来返回故事板提供的高度,因为不同的单元格可以有不同的高度。

也我的表视图分组,静态,和许多部分,如果这有助于使其更清晰。

我试过这个

 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.row == 5 && image==nil && [indexPath section] == 1){ NSLog(@"hide cvell"); return 0; } return tableView.rowHeight; } 

它似乎像return tableView.rowHeight; 还会返回44,所以没有变化:(


把它缩短,这是我需要帮助的;

 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.row == 5 && image==nil && [indexPath section] == 1){ NSLog(@"hide cvell"); return 0; } return WhatEverSizeFromStoryboard; } 

如果它是一个静态的单元格,你应该能够使用超类的实现来获得它:

 return [super tableView:tableView heightForRowAtIndexPath:indexPath];