从 ModalViewController 更新 splitViewController

发布于 2024-09-28 05:37:34 字数 470 浏览 0 评论 0原文

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

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

我尝试过:

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

[mrv updateTable];位于我的 RootView 中并包含 [tableView reloadData]; 如果我将 NSLog 放在那里,就会打印出来,只是表格在屏幕上时不会重新加载。

即使尝试了viewWill/DidAppear,也无济于事。

非常感谢任何帮助!

I need to update on of my splitView's from a modalView, but I am not having any luck.

for instance: From my rootView (which is a UITableVIewController) if I set an option to hide a certain section from the rootView table in my ModalView, when I dismiss the modalview, the setting doesnt take affect on screen for the tableview, same goes for detailView.

i've tried:

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

[mrv updateTable]; is located in my RootView and contains a [tableView reloadData];
If I place an NSLog in there, that prints, just that the table doesnt reload while on screen.

Even tried viewWill/DidAppear, no avail.

Any help much appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青芜 2024-10-05 05:37:34

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

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

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

So I was able to resolve this issue with Notifications.

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

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateView:) name:@"update" object:nil];
    - (void)updateView:(NSNotification *)notification {
        [tableView reloadData];
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文