Possible Duplicate:
iPhone orientation
Depending on what orientation the iPad is in, I need to either set the table view’s background or remove it because it doesn’t work with the popover.
I tried this but no luck:
if( [UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeLeft ){
self.navigationController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]];
self.tableView.backgroundColor = [UIColor clearColor];
NSLog(@"test");
Maybe there is a better way? To see if table is master or popover, then set background?
There are several ways to achieve what you want, more or less:
UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation];If you go with option 1, then you can check the orientation like so:
EDIT: To get your application to automatically rotate, you can do this: