改变window.rootViewController

2015-08-04  本文已影响1917人  扬扬扬

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

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

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

上一篇下一篇

猜你喜欢

热点阅读