在UIPopoverController中显示动态结果

时间:2013-11-20 18:04:50

标签: ios uisearchbar uipopovercontroller

我无法在由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 reloadData];没有被调用:弹出窗口出现(在搜索栏上方)但是有一个空表

0 个答案:

没有答案