Ios 在UIPopoverController中显示动态结果

Ios 在UIPopoverController中显示动态结果,ios,uisearchbar,uipopovercontroller,Ios,Uisearchbar,Uipopovercontroller,我无法在UIPopoverController管理的viewController“searchController”内设置数据: 在viewDidLoad中,我有: searchController = [[PopOverSearchController alloc] initWithNibName:@"PopOverSearchController" bundle:nil]; popoverController = [[UIPopoverController alloc] initWithC

我无法在UIPopoverController管理的viewController“searchController”内设置数据: 在viewDidLoad中,我有:

searchController = [[PopOverSearchController alloc] initWithNibName:@"PopOverSearchController" bundle:nil];

popoverController = [[UIPopoverController alloc] initWithContentViewController:searchController];
我使用一种方法调用此popover,效果很好:

if ([popoverController isPopoverVisible]) {
    [popoverController dismissPopoverAnimated:YES];
} else {


    searchController.data = data;
    [searchController.tableResult reloadData];

    CGRect popRect = CGRectMake(self.searchBar.frame.origin.x,
                                self.searchBar.frame.origin.y +15,
                                self.searchBar.frame.size.width,
                                self.searchBar.frame.size.height);
    [popoverController presentPopoverFromRect:popRect
                                       inView:self.view
                     permittedArrowDirections:UIPopoverArrowDirectionAny
                                     animated:YES];
}

[searchController.tableResult重新加载数据];未调用:弹出窗口出现(在搜索栏上方),但带有一个空表

请确保您在
searchController
的标题中声明了
UITableViewDataSource
协议,并且该表视图的
委托
属性设置正确。还请确保变量
data
中确实包含一些值。如果您可以从
searchController