0

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

例如:从我的rootView(这是一个UITableVIewController)如果我设置一个选项来隐藏我的ModalView的rootView表中的某个部分,当我关闭modalview时,该设置不会影响tableview的屏幕,同样适用详细视图。

我试过了:

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

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

甚至尝试过 viewWill/DidAppear,也无济于事。

非常感谢任何帮助!

4

1 回答 1

0

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

    [[NSNotificationCenter defaultCenter] postNotificationName:@"update" object:nil];

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateView:) name:@"update" object:nil];
    - (void)updateView:(NSNotification *)notification {
        [tableView reloadData];
    }
于 2010-10-19T06:13:24.323 回答