gpt4 book ai didi

iphone - 身份验证完成后转换到新 View

转载 作者:行者123 更新时间:2023-11-29 13:43:41 24 4
gpt4 key购买 nike

我目前有一个用 xcode 构建的简单 iPad 应用程序。

我有 2 个 uitextfields 和一个 uibutton

我的应用程序当前正在使用 asihttprequest 对后端输入用户名和密码进行身份验证。

当我在控制台中看到成功横幅时,身份验证正在工作。

我正在尝试将当前 View Controller 转换为新 View ,但我不太确定该怎么做。

我是否应该在我的 appdelegate 中声明一些东西才能发生这种情况?

最佳答案

是的,您可能需要在 AppDelegate 中声明一些内容。这将取决于您当前的布局,如果您有一个 UINavigationController 那么您要做的就是将一个新的 ViewController 插入此 UINavigationController 以执行此操作:

//Do this to push your new view controller, in this case named authenticationViewController
[myNavController pushViewController:authenticatedViewController animated:YES];

如果您不明白我在说什么,您可以在 documentation 中阅读更多关于 UINavigationController 类的内容。 ,我建议您阅读介绍,其中包含有关 UIViewController 及其转换的解释。

如果您已经有一个导航 Controller 和一个类,您可以做的是创建一个新的 UIViewController 子类,然后执行如下操作:

NewViewController *viewController=[[NewViewController alloc] initWithNibName:@"NewViewController" bundle:nil]; 
[[validationViewController navigationController] pushViewController:viewController animated:YES];

//Memory management
[viewController release];

关于iphone - 身份验证完成后转换到新 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8282906/

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