技术的乐趣在于分享,欢迎多多交流,多多沟通。
全部博文(877)
分类: iOS平台
2015-08-13 18:53:47
1 // 2 // YYbaseViewController.m 3 // 02-uitabbarcontroller 4 // 5 // Created by 孔医己 on 14-6-8. 6 // Copyright (c) 2014年 itcast. All rights reserved. 7 // 8 9 #import "YYbaseViewController.h" 10 11 @interface YYbaseViewController () 12 13 @end 14 15 @implementation YYbaseViewController 16 17 // 当控制器的view加载完毕就调用 18 - (void)viewDidLoad 19 { 20 [super viewDidLoad]; 21 NSLog(@"%@ - 控制器的view加载完毕", [self class]); 22 } 23 24 // 控制器即将显示的时候调用 25 - (void)viewWillAppear:(BOOL)animated 26 { 27 [super viewWillAppear:YES]; 28 NSLog(@"%@ - 控制器即将显示", [self class]); 29 } 30 31 // 控制器完全显示的时候调用 32 - (void)viewDidAppear:(BOOL)animated 33 { 34 [super viewDidAppear:animated]; 35 NSLog(@"%@ - 控制器完全显示", [self class]); 36 } 37 38 // 控制器即将消失的时候调用 39 - (void)viewWillDisappear:(BOOL)animated 40 { 41 [super viewWillDisappear:animated]; 42 NSLog(@"%@ - 控制器即将消失", [self class]); 43 } 44 // 控制器完全消失的时候调用 45 - (void)viewDidDisappear:(BOOL)animated 46 { 47 [super viewDidDisappear:animated]; 48 NSLog(@"%@ - 控制器完全消失", [self class]); 49 } 50 51 - (void)viewWillUnload 52 { 53 [super viewWillUnload]; 54 NSLog(@"%@ - view即将被销毁", [self class]); 55 } 56 57 - (void)viewDidUnload 58 { 59 [super viewDidUnload]; 60 NSLog(@"%@ - view完全被销毁", [self class]); 61 } 62 63 - (void)dealloc 64 { 65 NSLog(@"%@", [self class]); 66 } 67 68 @end
- (void)applicationDidBecomeActive:(UIApplication *)application { // 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. UITabBarController *tb=(UITabBarController*)self.window.rootViewController; NSLog(@"%@",NSStringFromCGRect(tb.tabBar.frame)); }
打印结果为: