gpt4 book ai didi

iphone - xcode 4.5 中的 iOS Storyboard

转载 作者:行者123 更新时间:2023-11-29 03:34:07 24 4
gpt4 key购买 nike

我已经启动了一个带有 Storyboard的 iOS 应用程序。在我的应用程序中,mainStoryBoard 从导航 Controller 开始。从导航的 View Controller ,我将 Controller 传递给第二个 View Controller ,通过编程 ([self performSegueWithIdentifier:@"currencyClick"sender:self]) 进行推送。在第二个 View Controller 上我有一个按钮。单击按钮后,我想返回导航的 View Controller ,如 [self.navigationController popViewControllerAnimated:YES] 但此处 self.navigationController popViewControllerAnimated:YES 不起作用。在我的项目中,我取消选中 Navigationcontroller 中的 Shows navigation Bar

NavigationController-(root viewcontroller)-> viewController --(push segue with [self performSegueWithIdentifier:@"currencyClick"sender:self];)-->CurrencyViewcontroller

在 currencyviewController 中我有一个按钮。单击按钮我想实现导航后退按钮单击事件。我如何以编程方式实现后退按钮,[self.navigationController popViewControllerAnimated:YES] 在这种情况下不起作用。

enter image description here

请帮我解决这个问题..提前致谢

最佳答案

要在第一个 View Controller 中调用第二个 Controller ,请使用:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"mainStoryBoard" bundle: nil];

SecondViewController *rvc = (SecondViewController *)[storyboard instantiateViewControllerWithIdentifier:@"SecondViewControllerNameInYourStoryBoard"];

[self.navigationController pushViewController:rvc animated:YES ];

而不是 self 执行...然后在你的第二个 Controller 中弹出应该可以工作。

关于iphone - xcode 4.5 中的 iOS Storyboard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19402626/

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