你的位置:首页 > 操作系统

[操作系统]找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;