好日子,如何從CustomViewController中更改RootViewController(在AppDelegate中)?
我的應用程序已被授權形式被裝載在AppDelegate中,並在簽名(檢查是在SigninController.m)後TabBarController應該出現(如應用程序的主視圖)(SigninController)。
我該如何改變控制器從登錄到TabBar和?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
SigninController *aSigninController = [[SigninController alloc] initWithNibName:@"SigninView" bundle:nil];
self.currentController = aSigninController;
[aSigninController release];
self.window.rootViewController = self.currentController;
[self.window makeKeyAndVisible];
return YES;
}
SigninController.m
- (IBAction)signinClick
{
........
if (loginOK == YES)
{
//This place is ready to send messages to show TabBar
} else {
UIAlertView *alert = ......
[alert show];
[alert release];
}
}
請標記您正在使用的編程語言。 –