我正在尝试编写一个 IBAction 来为我的 iPhone 应用程序切换视图控制器:
-(IBAction)changeToView2:(id)sender
{
if (self.view2 == nil)
{
view2 = [[UIViewController alloc] initWithNibName:@"View2Controller" bundle:[NSBundle mainBundle]];
}
self.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentedViewController: view2 animated:YES];
}
但是,我收到一个构建错误,指出没有接口声明“presentedViewController:animated:”。为什么?
将其更改为“presentViewController:animated:”会产生相同的错误。