1

에서 모달 뷰를 제시 이것은 내가 앱이 첫}시작하는 응용 프로그램 위임 불균형 통화/종료 외관

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 

self.window.rootViewController = self.tabBarController; 
[self.window makeKeyAndVisible]; 


Security *security = [[Security alloc] initWithNibName:@"Security" bundle:nil]; 
[self.tabBarController.selectedViewController presentModalViewController:security animated:YES]; 
[security release]; 

return YES; 

을 시작할 때 모달 뷰를 제공하기 위해 사용하고 코드는

이것은 무엇을이다 로그 란에

Unbalanced calls to begin/end appearance transitions for <UITabBarController: 0x171320>. 

이 방법이 더 좋습니까?

또한 내 애플 대리자 내 tabbarcontroller의 옵션의

-(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController { 

    if (viewController == [tabBarController.viewControllers objectAtIndex:2]) { 

     //The Log Out tab locks the app by presenting a modalviewcontroller that can't be dismissed unless there is a password. 
     Security *security = [[Security alloc] initWithNibName:@"Security" bundle:nil]; 
     [self.tabBarController presentModalViewController:security animated:YES]; 
     [security release]; 
     return NO; 

    } else { 

    return YES; 
    } 
} 

기본적으로 하나의 로그 아웃 버튼은이 방법을 가지고있다. 위의 코드는 정상적으로 작동하고 로그에 경고를 표시하지 않습니다.

+0

가능한 복제를 시도 : http://stackoverflow.com/questions/7886096/unbalanced-calls-to-begin- end-appearance-transitions-for -uitabbarcontroller-0x – Niko

+0

네, 매우 유사하지만 문제가 해결되지 않습니다. – Hackmodford

+0

어떤 메소드에서'presentModalViewController'를 호출합니까? – Sulthan

답변

0

왜 탭 표시 줄 컨트롤러에서 표시합니까? 당신의 위의 코드를 가정하는 것은의 UIViewController에서이다,이 질문의

[self presentModalViewController:security animated:YES]; 

또는

[self.navigationController presentModalViewController:security animated:YES]; 
+0

이것은 내 응용 프로그램 대리인입니다. 그냥 NSObject 그 이유는 내가 tabbarcontroller에서 제시했다 – Hackmodford

+0

당신의 모달 아래 살거야 viewController 넣어 다음 해당 viewController에서 위의 호출을 사용하여 모달을 엽니 다. 모달을 닫으면 viewController가 이미 실행 중입니다. –

+0

tabbarcontroller의보기 컨트롤러 중 하나에서이 첫 번째보기를 제시한다고 말하고 있습니까? – Hackmodford