How do I switch a new view controller in iOS development?
ios, objective-c
Solution
The method is `presentViewController:animated:completion:`, not `present`ed`ViewController:animated:`
Problem
I am trying to write an IBAction to switch view controllers for my iPhone application: ``` -(IBAction)changeToView2:(id)sender { if (self.view2 == nil) { view2 = [[UIViewController alloc] initWithNibName:@"View2Controller" bundle:[NSBundle mainBundle]]; } self.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentedViewController: view2 animated:YES]; } ``` However, I am getting a build error noting that no interface declares "presentedViewController:animated:". Why? Changing this to "presentViewController:animated:" produces the same error.