弹出的PresentedViewController,这是我正在使用的代码
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];当我试图取消popover视图本身时,会得到相同的警告
发布于 2014-08-01 05:30:20
在第一次修正以下线。
SearchPropertyVC *SearchPropertyVC *centerViewController = (SearchPropertyVC *)[board instantiateViewControllerWithIdentifier:@"vcSearchPropertyID"];
SearchPropertyVC *searchPropertyVC = (SearchPropertyVC *)[board instantiateViewControllerWithIdentifier:@"vcSearchPropertyID"];选择任何一种表达方式,
ConDetVC.modalPresentationStyle = UIModalPresentationPageSheet;
ConDetVC.modalPresentationStyle = UIModalPresentationFormSheet;页表或表单页。
当您尝试呈现时,请使用想要呈现的视图对象控制器。
[self presentViewController:ConDetVC animated:YES completion:nil]; 当它被驳回的时候,只需写信,
[self dismissViewControllerAnimated:YES completion:^{
// write you code here
}];发布于 2014-08-25 15:14:28
这将帮助你:
[self.presentedViewController dismissViewControllerAnimated: YES completion:^(void) {
[self presentViewController:myController animated:YES completion:nil];
}];https://stackoverflow.com/questions/25072971
复制相似问题