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.
The method is presentViewController:animated:completion:
, not present
edViewController:animated:
Instead of
[self presentedViewController: view2 animated:YES];
try
[self presentViewController: view2 animated:YES];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With