tags:

views:

101

answers:

0

Hi

I want to open an modal ViewController from my ipad splitview application. It works fine when I do it from the app-delegate:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

// Override point for customization after app launch.
// Add the split view controller's view to the window and display.

[window addSubview:splitViewController.view];
[window makeKeyAndVisible];

loginViewController = [[LoginViewController alloc]init];
loginViewController.delegate = self;
loginViewController.modalPresentationStyle = UIModalPresentationFormSheet;

[self.splitViewController presentModalViewController:self.loginViewController animated:YES];
return YES;
}

But when I want to do it from my DetailView it won't work:

LoginViewController *loginViewController = [[LoginViewController alloc]init];
[self presentModalViewController:loginViewController animated:YES];

Any ideas ?