从popoverview呈现的PrestedViewController,这是我正在使用的代码
SearchPropertyVC *SearchPropertyVC *centerViewController = (SearchPropertyVC *)[board instantiateViewControllerWithIdentifier:@"vcSearchPropertyID"];
UINavigationController *ConDetVC = [[UINavigationController alloc] initWithRootViewController:centerViewController];
ConDetVC.modalPresentationStyle = UIModalPresentationPageSheet;
ConDetVC.modalPresentationStyle = UIModalPresentationFormSheet;
ConDetVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:ConDetVC animated:YES completion:nil];
ConDetVC.view.superview.bounds = CGRectMake(0, 0, 700, 670);
控制器打开正常,当我尝试关闭控制器时,我收到此警告
“警告:在演示或关闭过程中尝试从视图控制器中关闭!”
之后,如果我单击任何按钮,应用程序将崩溃。
这是我用来关闭视图的代码
[self dismissViewControllerAnimated:YES completion:nil];
[self dismissViewControllerAnimated:YES completion:^{
[(UINavigationController *)self.presentingViewController popToRootViewControllerAnimated:YES];
}];
if (![self.presentedViewController isBeingDismissed])
[self dismissViewControllerAnimated:YES completion:nil];
当我尝试关闭弹出视图本身时,会收到相同的警告