gpt4 book ai didi

ios - 如何推送以编程方式创建的 UINavigationController 的新 View 宽度?

转载 作者:行者123 更新时间:2023-12-01 17:39:56 24 4
gpt4 key购买 nike

我尝试了这个网站的许多歌曲,但没有得到结果。现在我像这样打开新 View :

//(I call this code from View called MainReportView)
InfoController *info = (InfoController *)[self.storyboard instantiateViewControllerWithIdentifier:@"InfoController"];

info.login = login;
info.password = password;

[self presentViewController:info animated:YES completion:nil];

一切正常,但我希望以前的 View 在我返回给他时保持相同的状态。人们说使用 NavigationController 并推送给他,但这是一个问题。我将 NavigationController 添加到 Storyboard (到 MainReportView)并尝试将代码更改为:
 [self pushViewController:info animated:YES completion:nil];

但没有任何 react , View 未打开,请帮助我如何以编程方式在此代码中添加 NavigationController 并使用 push 打开我的 InfoController ?谢谢 ! (我使用 Xcode 5 和 iOS 7 + Storyboard)

解决方案 - 对于 iOS7 使用 prepareForSegue,这个 tutorial

最佳答案

enter image description here

UIStoryboard *MainStoryboard = [UIStoryboard storyboardWithName:@"Main"
bundle: nil];
InfoController *info=[MainStoryboard instantiateViewControllerWithIdentifier:@"InfoController"];
[self.navigationController pushViewController:info animated:YES completion:nil];

full step by step guide

关于ios - 如何推送以编程方式创建的 UINavigationController 的新 View 宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23075116/

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