Navigation in an iphone application
May be this one is easy.., I am new to iphone development.. My question is :
I want to present a new screen after successful login, My app displays a Login screen to the user, and I have implemented the login logic in -(IBAction)login:(id)sender method when we click on the su开发者_如何学运维bmit button.., After successful login, a new screen must be presented.
If you are using a Navigation controller you can push the new view controller onto the stack and display it through pushViewController: animated:
method. You can also use presentModalViewController: animated:
Or you can just add the new view as the subview of this view by [self.view addSubview:secondView];
you can refer
- Apple's UIViewController reference. Short and sweet (relatively).
- View Controller Programming Guide for iPhone OS.
UPDATE
Implement this in your current view controller
- (IBAction)buttonClicked
{
if(validated)
{
// code to show goes here.
}
}
精彩评论