For iOS 5 use - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)
in iOS 6, its deprecated but it wont matter if you use it. It will only get called in case its iOS 5.0 or below.
Updated: UIInterfaceOrientationMaskAllButUpsideDown is NOT an UIInterfaceOrientation enum type. Masking is used in iOS 6 to give a mask value to give a combination of orientations you want to support but in iOS 5.
You will have to check if the interfaceOrientaion is either of
UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight, UIInterfaceOrientationPortrait or UIInterfaceOrientationPortraightUpsideDown.
and return YES or NO based on which all orientations you want to support.
In your case Use:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
/* If you are supporting all, simply return YES,
if you aren't supporting any return NO, otherwise Use || and check which ones you wanna return YES for.
In this case you wanna support all except UpsideDown hence use this. */
}