문제

ProventedViewController popoverview에서 현재, 이것은 내가 사용하는 코드입니다

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);
.

컨트롤러가 잘 열립니다. 컨트롤러를 닫으려고 할 때이 경고를 받고 있습니다

"경고 : 프레젠테이션이나 기각이 진행되는 동안 View Controller에서 해산을 시도하십시오!"

누구나 누르면 앱이 충돌 할 수 없습니다.

이 코드를 사용하여 뷰를 닫는 데 사용하는 코드

[self dismissViewControllerAnimated:YES completion:nil];

[self dismissViewControllerAnimated:YES completion:^{
             [(UINavigationController *)self.presentingViewController popToRootViewControllerAnimated:YES];
         }];

if (![self.presentedViewController isBeingDismissed])
            [self dismissViewControllerAnimated:YES completion:nil];
.

Popover View 자체를 닫으려고 할 때

와 동일한 경고를 얻으려고합니다.

도움이 되었습니까?

해결책

라인 아래에서 매우 올바른다.

 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
     }];
.

다른 팁

이렇게하면 다음을 도와줍니다 :

 [self.presentedViewController dismissViewControllerAnimated: YES completion:^(void) {
             [self presentViewController:myController animated:YES completion:nil];
    }];
.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top