views:

186

answers:

1

Hi all... I have a viewController called MainViewController, which has a UIButton. When tapped, this button loads another viewController, called ModalSelector like this:

- (IBAction)showModalSelector:(id)sender {

ModalSelector *modal = [[ModalSelector alloc]
      initWithNibName:@"modalSelector" bundle:nil];
modal.modalPresentationStyle = UIModalPresentationFormSheet;
modal.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
modal.modalInPopover = YES;

modal.issues = issuesForModal;
modal.parent = self;

[self presentModalViewController:modal animated:YES];

[modal.view setFrame:CGRectMake(-80, 20, 700, 400)];

[issuesForModal release];
[modal release];

}

However, when I rotate the device in the simulator, neither view rotates properly, even though I have this in both viewControllers:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;

}

How can I make it rotate properly?

Thanks

A: 

I've discovered there's not a problem with the code, but with the simulator itself. When I test it on the actual device, it works perfectly.

The WebMacheter