Advertisement
Guest User

AppDelegate.m

a guest
Oct 8th, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #import "AppDelegate.h"
  2. #import "MainWindow.h"
  3. #import "History&Favorites.h"
  4. #import "DBScreenSwitcher.h"
  5.  
  6. @implementation AppDelegate
  7.  
  8. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  9. {
  10.     self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  11.     // Override point for customization after application launch.
  12.     self.window.backgroundColor = [UIColor whiteColor];
  13.    
  14.     MainWindow *mainWindow = [[[MainWindow  alloc] init]autorelease];
  15.     History_Favorites *bookmarks = [[[History_Favorites alloc]init]autorelease];
  16.     DBScreenSwitcher *dbSwitcher = [[[DBScreenSwitcher alloc]init]autorelease];
  17.    
  18.     UITabBarController *browserTabBar = [[UITabBarController alloc] init];
  19.     browserTabBar.viewControllers = @[mainWindow, bookmarks,dbSwitcher];
  20.     self.window.rootViewController = browserTabBar;
  21.  
  22.    
  23.     [browserTabBar release];
  24.    
  25.     [self.window makeKeyAndVisible];
  26.     return YES;
  27. }
  28.  
  29. - (void)applicationWillResignActive:(UIApplication *)application
  30. {
  31.     // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
  32.     // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
  33. }
  34.  
  35. - (void)applicationDidEnterBackground:(UIApplication *)application
  36. {
  37.     // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
  38.     // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
  39. }
  40.  
  41. - (void)applicationWillEnterForeground:(UIApplication *)application
  42. {
  43.     // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
  44. }
  45.  
  46. - (void)applicationDidBecomeActive:(UIApplication *)application
  47. {
  48.     // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
  49. }
  50.  
  51. - (void)applicationWillTerminate:(UIApplication *)application
  52. {
  53.     // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
  54. }
  55.  
  56. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement