ボタンのクリック時に rootviewcontroller から別のビューを表示する必要があります。次のコードを書きましたが、うまくいきません。理由はありますか?
私のアプリデリゲートメソッドには、次のコードがあります-
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
次に、私のmainviewcontrollerには、別のクラスに移動するはずのボタンアクションがありますが、何もしません。nslogステートメントが機能するため、ボタンアクションは機能していますが。何か案は?
LoginViewController * loginViewController = [[LoginViewController alloc]initWithNibName:@"LoginViewController" bundle:nil];
[self.modalViewController presentModalViewController:loginViewController animated:YES];
NSLog(@"HE::P");