搜索iOS8 + XCode6后不显示标题视图

Jag*_*een 5 uisearchdisplaycontroller xcode6 ios8 uisearchcontroller

我有iOS7及以下的工作应用程序
我使用UISearchDisplayController进行表格搜索.

问题:
iOS8中未显示搜索标题视图后.
如下图所示.

搜索之前: 在此输入图像描述

搜索后: 在此输入图像描述


我尝试使用UISearchController,但也有同样的问题,我使用此代码链接

我在TPSMastreViewController.m中添加以下代码

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *v = [[UIView alloc] init];
    v.backgroundColor = [UIColor greenColor];
    return v;
}
Run Code Online (Sandbox Code Playgroud)


我检查了那个委托 - (UIView*)tableView:(UITableView*)tableView
viewForHeaderInSection :( NSInteger)部分
在iOS8的情况下不调用.
编辑:
我所理解的只是调用UITableViewDataSource委托,UITableViewDelegate没有.
请注意,我在ViewDidLoad中设置了两个委托
问题:
1]是否是UI更改?
2]任何人都有补丁,以便委托方法强制调用.

Jag*_*een 5

我找到答案所以写在这里它可能会帮助其他人面临同样的问题

只需要添加委托heightForHeaderInSection,它将显示UISearchController(iOS8)的searchResultsController和UISearchDisplayController(iOS7)的searchResultsTableView的标题视图

在TPSMastreViewController.m中添加以下代码,它将解决问题.

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 20;
}
Run Code Online (Sandbox Code Playgroud)

在iOS 8中读到这个问题:)我找到了答案
UITableView heightForHeaderInSection不是可选的