So, as by the question, I use the following code to set userinterfaceOrientation for the viewcontroller.
- (BOOL) shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
I tried setting UIInterfaceOrientationMaskAll
for another viewController.
Prior, I checked all the items for Supported interface orientations
in the info-plist. Both the viewControllers returned true
(as set in the info-plist) for all the orientations and didn't obey the above code. IT worked even in the absence of the above code. Is there anyway to restrict certain Supported interface orientations
for particular classes? I made it working for the pre - iOS6 versions by following this link.