gpt4 book ai didi

objective-c - 以编程方式单击 navigationController 的 pushViewController 的左栏按钮(后退按钮)

转载 作者:太空狗 更新时间:2023-10-30 03:56:47 25 4
gpt4 key购买 nike

我想在我的第二个 View 中以编程方式单击 navigationBar 中的后退按钮。它是这样调用它的:

Archiv *archiv = [[Archiv alloc] initWithNibName:@"Archiv" bundle:nil];
archiv.title = [NSString stringWithFormat:@"Archiv %@", [sender titleForState:UIControlStateNormal]];
[self.navigationController pushViewController:archiv animated:YES];

现在我在 Archiv.m 中,在发生特定事件后我想返回到第一个 Controller (不单击后退按钮)- 相反,我想以编程方式执行单击。

这种情况有可能吗?

如果我点击这个按钮,知道调用哪个方法会很有帮助,所以甚至不必执行点击。

最佳答案

是的,你可以

这将带你到你的第一个 View Controller

 [self.navigationController popToRootViewControllerAnimated:YES];

关于objective-c - 以编程方式单击 navigationController 的 pushViewController 的左栏按钮(后退按钮),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7688112/

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