[英]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.