【问题标题】:Update splitViewController from ModalViewController从 ModalViewController 更新 splitViewController
【发布时间】:2010-10-19 05:58:37
【问题描述】:

我需要从 modalView 更新我的 splitView,但我没有任何运气。

例如:从我的 rootView(这是一个 UITableVIewController)中,如果我在 ModalView 中设置了隐藏 rootView 表中的某个部分的选项,当我关闭 modalview 时,该设置不会影响 tableview 的屏幕, detailView 也是如此。

我试过了:

    MyRootView *mrv = [MyRootView alloc] init];
    [mrv updateTable];
    [mrv release];

[mrv 更新表];位于我的 RootView 并包含一个 [tableView reloadData]; 如果我在其中放置一个 NSLog,则会打印出来,只是表格在屏幕上时不会重新加载。

连viewWill/DidAppear都试过了,没用。

非常感谢任何帮助!

【问题讨论】:

    标签: ipad uitableview uisplitviewcontroller modalviewcontroller


    【解决方案1】:

    所以我能够通过通知解决这个问题。

        [[NSNotificationCenter defaultCenter] postNotificationName:@"update" object:nil];
    
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateView:) name:@"update" object:nil];
        - (void)updateView:(NSNotification *)notification {
            [tableView reloadData];
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多