0

I need to show another view from rootviewcontroller on button click. I have written the following code but it doesnt work. Any ideas why?

In my app delegate method i have the following code -

- (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;
}

Then in my mainviewcontroller i have a button action which is supposed to take me to a different class but it does nothing. Although the button action is working since nslog statements work. Any ideas?

   LoginViewController * loginViewController = [[LoginViewController alloc]initWithNibName:@"LoginViewController" bundle:nil];
   [self.modalViewController presentModalViewController:loginViewController animated:YES];
NSLog(@"HE::P");
CodeGeek123
  • 4,341
  • 8
  • 50
  • 79

1 Answers1

2

If you try :

[self presentModalViewController:loginViewController animated:YES];
Pierre
  • 10,593
  • 5
  • 50
  • 80