If my iPad is in Landscape mode and presentModalViewController is called the view automatically turns into portrait mode. Any solutions?
UIViewController * start = [[UIViewController alloc]initWithNibName:@"SecondView" bundle:nil];
start.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
start.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:start animated:YES];
In SecondView I’ve already added:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
The problem is your sample code is creating UIViewController instead of your actual derived class. In other words instead you should be creating your controller like this:
I’m assuming your view controller class is called “SecondViewController” because you were loading a nib by a similar name.
If you don’t provide the right instance there is no way your delegate methods can be called.