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

有沒有更好的方法來實現這一目標?

此外,我在我的應用程序委託

-(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; 
    } 
} 

對我tabbarcontroller的選項基本上一個是註銷按鈕有這樣的方法。上面的代碼工作正常,不會向日志發出警告。

+0

這個問題的可能的複製:http://stackoverflow.com/questions/7886096/unbalanced-calls-to-begin- end-appearance-transitions-for-uitabbarcontroller-0x – Niko 2011-12-15 14:33:24

+0

是的,它非常類似,但它不能解決我的問題。 – Hackmodford 2011-12-15 14:42:15

回答

0

你爲什麼要從你的標籤欄控制器呈現它?假設你上面的代碼是從一個UIViewController,嘗試

[self presentModalViewController:security animated:YES]; 

[self.navigationController presentModalViewController:security animated:YES]; 
相關問題