- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
UIView *v = self.view;
NSLog(@"%@",v);//存在
UIWindow *w = self.view.window;
NSLog(@"%@",w);//nil
UIWindow *ww = [UIApplication sharedApplication].delegate.window;
NSLog(@"%@",ww);//存在
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
UIView *v = self.view;
NSLog(@"%@",v);//存在
UIWindow *w = self.view.window;
NSLog(@"%@",w);//存在
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIView *v = self.view;
NSLog(@"%@",v);//存在
UIWindow *w = self.view.window;
NSLog(@"%@",w);//nil
}