我在我的应用程序中使用 MGSplitViewController。从一个视图控制器,单击按钮,我将控件导航到这两种方法,其中 Formsheet 将以 MGSplitViewController 的背景打开(显示主视图和详细视图。)
这些方法运行良好,我得到了所需的结果,但经过多次操作后,应用程序在这一点上崩溃而没有打印任何日志。谁能建议我一些解决方案?
-(void)launchSplitViewWithFormSheet :(MGSplitViewController *)mGSplitViewController
{
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:mGSplitViewController];
[self.baseNavigationController setViewControllers:[NSArray arrayWithObject:navController]];
[self openFormSheet:mGSplitViewController];
}
-(void)openFormSheet:(MGSplitViewController *)mGSplitViewController
{
DetailViewController *detailViewController = (DetailViewController *)[mGSplitViewController.viewControllers objectAtIndex:0];
MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil];
UINavigationController *baseNavController = [[UINavigationController alloc]initWithRootViewController:masterViewController];
detailViewController.masterViewController = detailViewController;
baseNavController.modalPresentationStyle = UIModalPresentationFormSheet;
[mGSplitViewController presentModalViewController:baseNavController animated:YES];
}