1

2 개의보기 컨트롤러가 있습니다. FirstViewControllerSecondViewController. 두 번째는 두 알림을 듣고 presentViewController...경고 : 프레젠테이션 또는 취소가 진행되는 동안보기 컨트롤러 (UINavigationController)에서 닫으려고 시도합니다.

를 통해 제공됩니다 : 기각

- (void)facebookUpdated:(NSNotification *)notification { 

    if (![[FacebookHelper sharedInstance] isLoggedIn]) { 

     // The user decided not to log in 

     [self dismissViewControllerAnimated:YES completion:^{ 

     }]; 
    } 
} 

SecondViewController SecondViewController.m

FirstViewController.m

- (void)facebookUpdated:(NSNotification *)notification { 

    if (![[FacebookHelper sharedInstance] isLoggedIn]) { 

     [self.addReminderTableView reloadSections:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(1, 2)] withRowAnimation:UITableViewRowAnimationFade]; 

    } 
} 

및 에있는 테이블 FirstViewController이 다시로드되었습니다. 프리젠 테이션 또는 해고가 진행 동안 뷰 컨트롤러 에서 기각 시도 :하지만 내가

경고를 좋아하지 않는이 경고를 받고 있어요!

그리고 왜 나는 그것을 얻고 있는지 잘 모르겠습니다. 진행중인 다른 해고가 없다고 확신합니다. 진행중인 프리젠 테이션이 무엇을 의미하는지 모르겠습니다.

답변

0

이 경고는 SecondViewController(void)facebookUpdated:(NSNotification *)notification에 대한 호출로 해고되고 처음에 나타나는 애니메이션이 완료되기 전에 발생하는 경우에 발생할 수 있습니다.

당신은 할 수 있습니다

  1. 이 바로 기각 될 가능성이있는 경우 SecondViewController의 표시를 애니메이션하지 않음으로써 그것을 피 경고를 무시합니다.
  2. 두 번째보기 컨트롤러에서 애니메이션이 끝났음을 알리는 함수를 호출하는 초기보기 컨트롤러 애니메이션에서 콜백을 설정하여 애니메이션을 허용하면서 피하십시오. 그런 다음 을 호출하기 전에 (void)facebookUpdated:(NSNotification *)notification에서이 속성을 확인할 수 있습니다.로드가 완료되지 않은 경우 원래 애니메이션 콜백 함수가 dismissViewControllerAnimated이되도록 다른 플래그를 설정합니다. (가장 올바른 해결 방법이지만 가장 복잡합니다.)