2012-09-28 2 views
0

에 내가 modalViewController의 해고에 관한 iOS6의 문제에 직면하고있다해고 modalViewcontroller 오류가 iOS6의

다음

내가 공유하고 코드입니다 .1. 그러나 ios6에서 작동하지 못했습니다. 해제하려는 모달보기 컨트롤러가 해제되지 않습니다. 대신이 오류를 보여줍니다.

보기가 현재 나타나지 않는 모달보기 컨트롤러를 닫으려고합니다. 자기 = UINavigationController가 : 0xa947440 modalViewController = UINavigationController가 : 0x8c36170

을하지만 presentModalViewController를 사용하여 그 뷰 컨트롤러를 제공하려 할 때 그것은

경고 표시 : 이미 UINavigationController가 제시된다 0xa947440 : UINavigationController가 상에 존재하는 시도를 0x8c36170을

ios6에 대한 해결 방법 및 해결 방법을 제안하십시오.

+0

을 사용할 수 있습니다 ch 컨트롤러에서 modalView를 표시합니다. 해당 코드를 지정하십시오. – andyPaul

답변

0

에 대한 답변 중 하나를 참조하는 대신 내가 사용한 탐색 컨트롤러를 모달 뷰 컨트롤러를 사용하여 현재 모달보기 대신 CAAnimation를 사용하여 푸시보기를 사용할 수 실제로 애플이 방법을 추천도 대신 -----이다 컨트롤러

ShareViewController *share=[[ShareViewController alloc] initWithNibName:@"ShareViewController" bundle:nil]; 
    UINavigationController *nav=[[UINavigationController alloc]initWithRootViewController:share]; 
    share.modalPresentationStyle=UIModalPresentationFormSheet; 
    share.modalTransitionStyle=UIModalTransitionStyleCrossDissolve; 
    [self presentModalViewController:nav animated:YES]; 

    [share release]; 
    [nav release]; 

우리는 WHI에서이

ShareViewController *share=[[ShareViewController alloc] initWithNibName:@"ShareViewController" bundle:nil]; 

    CATransition* transition = [CATransition animation]; 
    transition.duration = 0.4; 
    transition.type = kCATransitionFade; 
    transition.subtype = kCATransitionFromTop; 

    [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; 
    [self.navigationController pushViewController:share animated:NO]; 

    [share release]; 
+0

navigationController의 pushViewController에 대한 presentModalViewController를 변경하면 EXC_BAD_ACCESS 예외가 발생합니다. 왜 그런가요? 이미 거기에 viewController가 있기 때문입니까? – Danny