I have overridden my UINavigationController to implement these methods:
-(BOOL)shouldAutorotate
{
return [[self.viewControllers lastObject] shouldAutorotate]
I did this in this way
-(BOOL) shouldAutorotate{
return YES;
}
-(NSUInteger) supportedInterfaceOrientations{
if ([self.visibleViewController isKindOfClass:[ZoomPictureViewController class]]) {
return UIInterfaceOrientationMaskAll;
}
return UIInterfaceOrientationMaskPortrait;
}
Make sure you've clicked the orientation buttons in Xcode to enable the orientations you want and return the orientations in supportedInterfaceOrientations method.