简体   繁体   中英

transitioning to a new view after authentication is complete

I currently have a simple iPad application built in xcode.

I have 2 uitextfields and a uibutton .

I have the application currently authenticating against a backend the username and password being input using asihttprequest .

Authentication is working as I see the success banner in the console.

I am trying have the current view controller transition to a new view but I am not totally sure how to do that.

Should I be declaring something within my appdelegate for this to happen?

Yes you probably need to declare something in your AppDelegate. This will be depending on your current layout, if you have a UINavigationController then what you will be doing is pushing a new ViewController into this UINavigationController to do this use:

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

If you do not understand about what I'm talking about you can read more about the UINavigationController Class in the documentation , I recommend you to read the introduction which contains an explanation about UIViewControllers and their transitions.

If you already have a navigation controller and a class, what you can do is to create a new subclass of UIViewController and then do something like:

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

//Memory management
[viewController release];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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