Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 14th, 2012  |  syntax: None  |  size: 1.30 KB  |  hits: 59  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. presenting modal view from app delegate unbalanced calls to begin/end appearance
  2. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  3.  
  4. self.window.rootViewController = self.tabBarController;
  5. [self.window makeKeyAndVisible];
  6.  
  7.  
  8. Security *security = [[Security alloc] initWithNibName:@"Security" bundle:nil];
  9. [self.tabBarController.selectedViewController presentModalViewController:security animated:YES];
  10. [security release];
  11.  
  12. return YES;
  13.        
  14. Unbalanced calls to begin/end appearance transitions for <UITabBarController: 0x171320>.
  15.        
  16. -(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {
  17.  
  18.     if (viewController == [tabBarController.viewControllers objectAtIndex:2]) {
  19.  
  20.         //The Log Out tab locks the app by presenting a modalviewcontroller that can't be dismissed unless there is a password.
  21.         Security *security = [[Security alloc] initWithNibName:@"Security" bundle:nil];
  22.         [self.tabBarController presentModalViewController:security animated:YES];
  23.         [security release];
  24.         return NO;
  25.  
  26.     } else {
  27.  
  28.     return YES;
  29.     }
  30. }
  31.        
  32. [self presentModalViewController:security animated:YES];
  33.        
  34. [self.navigationController presentModalViewController:security animated:YES];