iOS Popover和tableviewcontroller刷新问题

iOS Popover和tableviewcontroller刷新问题,ios,xcode,ipad,uitableview,uipopovercontroller,Ios,Xcode,Ipad,Uitableview,Uipopovercontroller,我正在写一个模拟iPad主/细节布局的项目。 所以我有一个masterView(UITableView)、一个detailView(UICollectionView)、一个全局导航栏和一个选项卡栏。 选项卡栏中填充了一些我需要选择的类别,而主视图则根据所选的选项卡项填充 在横向模式下,同时显示主视图和详细视图时,一切正常。 在纵向模式下,我的主视图是隐藏的,我有一个按钮可以打开一个带有主视图的弹出控制器。问题是,此弹出窗口似乎没有显示对masterview内容所做的更改 主视图是一个UITabl

我正在写一个模拟iPad主/细节布局的项目。 所以我有一个masterView(UITableView)、一个detailView(UICollectionView)、一个全局导航栏和一个选项卡栏。 选项卡栏中填充了一些我需要选择的类别,而主视图则根据所选的选项卡项填充

在横向模式下,同时显示主视图和详细视图时,一切正常。 在纵向模式下,我的主视图是隐藏的,我有一个按钮可以打开一个带有主视图的弹出控制器。问题是,此弹出窗口似乎没有显示对masterview内容所做的更改

主视图是一个UITableViewController。 我已经正确地实现了委托和数据源方法

下面是打开/关闭popover的代码

if(myPopIsVisible)
{
    myPop = [[UIPopoverController alloc]initWithContentViewController:myMasterView];
    [myPop presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    myPopIsVisible = YES;
}
else
{
    [myPop dismissPopoverAnimated:YES];
    myPopIsVisible = NO;
}
签入调试它可以让我了解myMasterView的正确内容(行数和内容),但它只显示应用程序加载的第一个内容

我用的是ARC

这是myMasterView类的实现

@implementation myMasterView{
    NSArray *cellTitles;
    NSArray *cellIco;
    NSArray *cellTag;
}

- (void) setData:(NSArray *)titles :(NSArray *)icos :(NSArray *)tags
{
     cellTitles = titles;
     cellIco = icos;
     cellTag = tags;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    //static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];

    if(cell == nil){
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];
    // Configure the cell...
        cell.textLabel.text = [cellTitles objectAtIndex:indexPath.row];
        cell.tag = [[cellTag objectAtIndex:indexPath.row] integerValue];
    #warning icona non impostata
    //    cell.imageView.image = [cellIco objectAtIndex:indexPath.row];
    }
    return cell;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return [cellTitles count];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return 1;
}

#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if(isPopover)
    {
        isPopover = NO;
        [master dismissPopoverController];
    }

}