I have an application written in an old version of Xcode. I am currently using Xcode 4.6.1. This is an application that I inherited from another developer that was developed outside the company.
One of the problems with this application is its interface. It should use LandscapeLeft by default (this is the value set in the pList file). An application ignores this directive and instead performs default portrait mode.
Is there anything I need to do to get the code to abide by this value? I am relatively new to iOS / Objective-C. The code compiles and runs, it's just that the interface does not do what I want.
This is a little easier since this is an iPad app.
Edit
I tried adding the following code to one of my problematic viewControllers, but this is not respected. Any thoughts on how to get this view to change the landscape? (Is there a setting in the IDE - it looks like Xcode is used for the orientation attribute, but I cannot find it in 4.6.1)
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return ((interfaceOrientation==UIInterfaceOrientationMaskLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationMaskLandscapeRight));
}
- (NSUInteger) supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
- (NSInteger) supportedInterfaceOrientationsForWindow
{
return UIInterfaceOrientationMaskLandscape;
}
- (BOOL) shouldAutoRotate
{
return YES;
}
source
share