best-practices for displaying new view controllers ( iPhone )

Posted by Tristan on Stack Overflow See other posts from Stack Overflow or by Tristan
Published on 2010-02-16T05:17:46Z Indexed on 2010/04/01 2:23 UTC
Read the original article Hit count: 531

I need to display a couple of view controllers (eg, login screen, registration screen etc). What's the best way to bring each screen up?

Currently for each screen that I'd like to display, I call a different method in the app delegate like this: Code:

- (void) registerScreen
{
 RegistrationViewController *reg = [[RegistrationViewController alloc] initWithNibName:@"RegistrationViewController" bundle:nil];
 [window addSubview:reg.view]; 
}
- (void) LoginScreen
{
 LoginViewController *log = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
 [window addSubview:log.view]; 
}

It works, but I cant imagine it being the best way.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about xcode