as usual I'm stuck again with a very simple problem but quite stressful here. just a simple case : I'm about to switch between two views but only with landscape orientation(left&right). actually its easy when i switch directly using a rect button and switch back to main view using the same method. But the problem occurred when i put uipopover between. so for example when i pressed the button from main view, before it switch, the popover appeared with rect button inside the popover and after i pressed the button, the second view appeared. Here is where the problem begin. in second view when I'm trying to put the device from landscape right to landscape left, the second view just stuck but the main view(in the background) did rotate to the assign orientation. heres the code i use in both implementation file :
#import "landscapeViewController.h"
#import "popOver.h"
@interface landscapeViewController ()
@end
@implementation landscapeViewController
@synthesize myPopover;
-(IBAction)showPop:(id)sender {
popOver *popover = [[popOver alloc] init];
UIPopoverController *pop1 = [[UIPopoverController alloc] initWithContentViewController:popover];
self.myPopover = pop1;
[pop1 setDelegate:self];
[pop1 setPopoverContentSize:CGSizeMake(300,200)];
[self.myPopover presentPopoverFromRect:[popbtn bounds] inView:popbtn permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
@end
and this is the code for switching views :
-(IBAction)switchView:(id)sender {
secondView *second = [[secondView alloc] initWithNibName:nil bundle:nil];
second.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:second animated:YES];
[self dismissModalViewControllerAnimated:YES];
}
and to switch back from second view :
-(IBAction)switchBack:(id)sender {
landscapeViewController *land = [[landscapeViewController alloc] initWithNibName:nil bundle:nil];
land.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:land animated:YES];
}
i hope someone can help me with this. thanks in advanced. again sorry for the bad english.