改变window.rootViewController

建立新的ViewController
NewViewController *newViewController = [[NewViewController alloc] init];

获取应用的AppDelegate
AppDelegate *newDelegate = [[UIApplication sharedApplication] delegate];

设置rootViewController
newDelegate.window.rootViewController = newViewController;
[newDelegate.window makeKeyAndVisible];

你可能感兴趣的:(改变window.rootViewController)