0
我的AppDelegate決定哪個控制器加載取決於如果用戶登錄或不(使用OAuth)。最好的方法來改變控制器
當用戶打開的第一次或後註銷應用所以我有這個
....
if ([auth isValid] == NO){
// open the authentication screen
AuthenticationViewController *controller = [[AuthenticationViewController alloc]init];
self.window.rootViewController = controller;
[controller release];
}else{
// open the default view controller
self.window.rootViewController = self.viewController;
}
[self.window makeKeyAndVisible];
return YES;
,他/她將被重定向到AuthenticationViewController。
如果用戶關閉(終止應用程序)並再次打開它,由於驗證過程已完成,他/她將看到默認視圖控制器(UITabBarController)。
實時更改這些控制器的最佳方法是什麼?