- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
//check for which controller u need these methods
if([navigationController.visibleViewController isKindOfClass:[yourViewController class]]) //provide specific view controller where u want protrait
Note : remove from all viewController if u have added category for UINavigationController. It should be only in appDelegate.
hi prince.. Yesterday problem was with iPad mini's button, once I switch it works fine... :). Today's question: where should I add this, I have tried in corresponding views before.. It didn't worked.
In controller function is not getting called.
I have added it in category, there also preferredInterfaceOrientationForPresentation in not got hit while loading initially.
App hanged when I add the above code :(
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window this function is getting called multiple times for me whenever it is called category method also called, again coming back to same function...leads to finally hanging and crash, category is in app delegate.mm only