My Root View Controller is in portrait mode. I have a button on this Root View Controller and the button action code is shown here:
-(IBAction)VideosView
{
VideosDetailViewController *videoview=[[VideosDetailViewController alloc] initWithNibName:@"VideosDetailViewController" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:videoview animated:YES];
[videoview release];
}
I would like my VideosDetailViewController to be in landscape mode. To solve this problem I've tried many methods but none works for me. This is what I have tried so far:
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeLeft;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
return (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
But this does not work for me. Any suggestions?