Ios 在UIStoryBoard上使用UISearchDisplayController时无单元格

Ios 在UIStoryBoard上使用UISearchDisplayController时无单元格,ios,xcode4.2,searchbar,uistoryboard,Ios,Xcode4.2,Searchbar,Uistoryboard,我在iPhone项目中使用UIStoryboard,有一个控制器,它是UITableViewController的子类,还有UISearchDisplayController 在tableView:cellForRowAtIndexPath中,我使用以下方法获取单元格: MyCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier]; CellIdentifier是我的原型单元格的标识符。当显示表

我在iPhone项目中使用UIStoryboard,有一个控制器,它是UITableViewController的子类,还有UISearchDisplayController

在tableView:cellForRowAtIndexPath中,我使用以下方法获取单元格:

MyCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
CellIdentifier是我的原型单元格的标识符。当显示表行时,这可以正常工作,但一旦我编辑了搜索栏,并且视图试图显示搜索结果,我得到了nil单元格。

添加以下内容:

if (cell == nil) {
    cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
}
而且,如果像我一样,更改了表单元格行的行高,那么也需要实现此方法

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return self.tableView.rowHeight;
}