Ios 在iPad上一个接一个地展示两个ModalViewController

Ios 在iPad上一个接一个地展示两个ModalViewController,ios,uisplitviewcontroller,modalviewcontroller,ipad,Ios,Uisplitviewcontroller,Modalviewcontroller,Ipad,我正在开发一个ipad应用程序,我使用了一个选项卡作为rootViewController,在每个选项卡中我都有SplitViewController。现在,我用这种方式点击一个按钮,展示一个ModalView - (void)someFunction { if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { AppDelegate *appDele

我正在开发一个ipad应用程序,我使用了一个选项卡作为rootViewController,在每个选项卡中我都有SplitViewController。现在,我用这种方式点击一个按钮,展示一个ModalView

- (void)someFunction
{

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
        {
            AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
           TestViewController *test = [[TestViewController alloc]initWithNibName:@"TestViewController" bundle:nil];
            moveNote.modalPresentationStyle = UIModalPresentationFormSheet;

            [appDelegate.splitViewController2 presentModalViewController:test animated:YES];
            test.view.superview.bounds = CGRectMake(0, 0, 540, 350);//Dimensions of ModalView.
         }

}
我通过SplitviewController演示ModalView

现在它正确地打开了。现在在这里面我有一个按钮,点击它我想关闭这个ModalView并展示另一个ModalView。为此,我编写了以下代码

- (void)closeTest
{
[self dismissViewControllerAnimated:YES
                                 completion:^{


                                     EditViewController *editViewController = [[EditViewController alloc] initWithNibName:@"EditViewController" bundle:nil];
                                     editViewController.modalPresentationStyle = UIModalPresentationFormSheet;

                                     [appDelegate.splitViewController2 presentModalViewController:editViewController animated:YES];
                                     editViewController.view.superview.bounds = CGRectMake(0, 0, 540, 350);//Dimensions of ModalView.
                                     editViewController.page = 3;              


                                     //Call delegate function.
                                 }];      
    }
}
但这不起作用,我的应用程序崩溃了

我在这里做错了什么

问候
Ranjit

没有获取任何崩溃日志您调试了完成块代码。控制器是否正确创建?演示后是否调用委托方法?我的第一个ModalView被正确地解除,控件进入块内,以演示另一个ModalView,但在这里它不起作用如果使用动画:否演示第二个模态会发生什么?