繁体   English   中英

身份验证完成后过渡到新视图

[英]transitioning to a new view after authentication is complete

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

我有2个uitextfields和一个uibutton

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

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

我正在尝试将当前的视图控制器过渡到新视图,但是我不确定如何做到这一点。

我是否应该在我的appdelegate声明某些事情发生?

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

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

如果您不了解我在说什么,则可以在文档中阅读有关UINavigationController类的更多信息,建议您阅读引言,其中包含有关UIViewControllers及其转换的说明。

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

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

//Memory management
[viewController release];

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM