找window的三种方法

LoginViewController * loginVC = [[LoginViewController alloc]init]; 找window的三种方式 1、// UIWindow * window = [UIApplication sharedApplication].delegate.window;等同于 UIWindow * window = [[[UIApplication sharedApplication]delegate]window]; 2、// UIWindow * window = [UIApplication sharedApplication].keyWindow; 3、 UIWindow * window = [[UIApplication sharedApplication].windows objectAtIndex:0]; window.rootViewController = loginVC;
posted @ 2016-05-17 17:49  iOS张文权  阅读(443)  评论(0编辑  收藏  举报