내 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)가 표시됩니다.
이러한 컨트롤러간에 실시간으로 변경하는 가장 좋은 방법은 무엇입니까?