I am working on a project and facing a problem. My problem is that i am making a project for 5.0 and above, My project is all in portrait view but only one view has both view (Landscape and portrait) i am using NavigationController custom class and check Orientations like this in custom navigation class `
- (NSUInteger)supportedInterfaceOrientations
{
int interfaceOrientation = 0;
if (self.viewControllers.count > 0)
{
id viewController;
for (viewController in self.viewControllers)
{
if ([viewController isKindOfClass:([CalenderViewController class])])
{
interfaceOrientation = UIInterfaceOrientationMaskAll;
}
else
{
interfaceOrientation = UIInterfaceOrientationMaskPortrait;
}
}
}
return interfaceOrientation;
}`
CalenderViewController is my view that supported both view this code works fine for popview when i pop a view to CalenderViewController, this works fine but when i push a new view controller on CalenderViewController that has only portrait view then the new viewcontroller remains in landscape, whereas it should be in portrait mode .Looking forward for a solution thanks