0

나는 모달 형식으로 제시 한보기 컨트롤러 (MailServicesController)가 있습니다. 이 MailServicesController에 UINavigationController (프로그래밍 방식으로)를 추가하여 다른 뷰 컨트롤러 (LoginController)를 밀어 넣을 수있게하려고합니다. 나는이 작업을 수행하는 코드를 구현했지만이 특정 문제가 오전 :푸시 & 팝 문제 프로그래밍 방식으로 만든 UINavigationController

  1. 네비게이션 컨트롤러가 스택의 맨 위에 loginViewController을 밀어을하지만, YES I가 애니메이션 BOOL을 설정 한 경우에도이 전환을 애니메이션하지 않습니다 푸시 방식.

  2. 한 번 loginViewController에서 popViewControllerAnimated를 사용하려고하면 아무 것도 발생하지 않습니다. 나는 내비게이션 버튼을 내비게이션 컨트롤러의 탐색 바를 사용하지 않고 있습니다. 여기

내가 MailServices 모달 뷰 컨트롤러 내부의 탐색 컨트롤러를 만드는 데 사용하는 코드는 다음 인 LoginController에 그런

self.navigationController = [[UINavigationController alloc]init]; 
[self.navigationController willMoveToParentViewController:self]; 
self.navigationController.view.frame = self.view.frame; 
[self.view addSubview:self.navigationController.view]; 
[self addChildViewController:self.navigationController]; 
[self.navigationController didMoveToParentViewController:self]; 
[self.navigationController pushViewController:LoginController animated:YES]; 
//pushes login controller but with no animation 

을, 나는 컨트롤러를 나타 내기 위해 맨 오프 인 LoginController을 팝업하려고 나는이 사람이 내 실수를 볼 수있는, 내가 잘못 뭐하는 거지 확실하지 않다

- (void)dismissView //called by a button in my custom toolbar 
{ 

    UINavigationController *navigationController = (UINavigationController 
    *)self.parentViewController; //this is the navigationController I created 
    [navigationController popViewControllerAnimated:YES]; //is called but does nothing 
} 

: 나는에서 밀어?

+0

어디 – codercat

+0

난 단지 내가 루트로 MailServicesController와 네비게이션 컨트롤러를 초기화하기 후 경우, 응용 프로그램 전반에 걸쳐 탐색 또는 혼자 두 클래스 – jac300

+0

에서 초기화 그런 다음 모달 형식으로 MailServicesController를 표시하려고하면 충돌이 발생합니다. – codercat

답변

0

MailServicesController에 모달 제시하는 동안은 사용 지금은 모든 UINavigationController가

의 특성 MailServicesController에서

loginViewController을 누르면서이, 당신의 MailServicesController을 제시 그 후이

MailServicesController *vc = [[MailServicesController alloc]init]; 
UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:vc]; 
[self presentModalViewController:navController animated:YES]; 

같이 할

LoginViewController *vc = [[LoginViewController alloc]init]; 
[self.navigationController pushViewController:vc animated:YES]; 

팝업하는 동안 LoginViewController

당신도 그렇지 않으면 UINavigation 컨트롤러를 초기화 (210)
- (void)dismissView //called by a button in my custom toolbar 
{ 

    [self.navigationController popViewControllerAnimated:YES]; //is called but does nothing 
} 
+0

감사합니다 위의 코드 – jac300

+0

업데이트 된 답변을 확인하십시오. 그것은 작동해야합니다. 그리고 MailServicesController 내부에 UINavigationController를 만드는 데 사용한 코드를 제거하십시오 –

+0

예, 감사합니다! – jac300

관련 문제