gpt4 book ai didi

iphone - 隐藏第二个 View Controller 并导航到第三个 View Controller

转载 作者:行者123 更新时间:2023-12-03 21:04:54 25 4
gpt4 key购买 nike

我在ViewControllerA中,其他ViewControllerB也加载在 View Controller 的stack.viewControllerB中,也有相机屏幕。从 ViewControllerA 我通过以下代码调用 ViewControllerB:

AppNameAppDelegate *appDelegate = (AppNameAppDelegate *)[[UIApplication sharedApplication] delegate];
ViewControllerB *l_ViewControllerB = [appDelegate ViewControllerB];
l_ViewControllerB.view.hidden = NO;
[self.navigationController pushViewController:l_ViewControllerB animated:YES];

现在,我想从 ViewControllerB 切换到 ViewControllerC

self.view.hidden = YES;
ViewControllerC *l_ViewControllerC = [[ViewControllerC alloc] init];
[self.navigationController pushViewController:l_ViewControllerC animated:YES];
[l_ViewControllerC release];

但它导航到我不需要的ViewControllerA,所以我需要帮助,如何导航到ViewControllerC而不显示ViewControllerA

更新:ViewControllerB定义在ViewControllerB.mm文件中,ViewControllerB.mm文件中还涉及一些C++编码。这会对 ViewControllerB.m 或 ViewControllerB.mm 文件中定义的 ViewControllerB 产生任何影响吗?

最佳答案

您应该删除这两行,除非有一些您没有提到的原因:

// in ViewControllerA:
l_ViewControllerB.view.hidden = NO;

// in ViewControllerB:
self.view.hidden = YES;

关于iphone - 隐藏第二个 View Controller 并导航到第三个 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8305993/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com