Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8629835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:54:31+00:00 2026-06-12T08:54:31+00:00

I am using UINavigationController in my application and my first controller called A and

  • 0

I am using UINavigationController in my application and my first controller called A and it is strict to portrite only and there is a button in my A controller.Once I click on the button I am creating instance to the another view controller called B. After creating the instance for B I am presenting modally using below method

[self presentViewController:BInstance animated:YES completion:^{
            NSLog(@"completed");
        }];

My B controller can able will support all the orientations, this is expected, till the ios5.1 and earlier versions. Now I am trying to run my project on the ios6 using Xcode4.5 it is not getting rotated I am looking forward to solve the issue I found some of the blogs about shouldAutorotateToInterfaceOrientation: method got deprecated from the latest ios6. I used alternative also

-(BOOL)shouldAutorotate{
    return YES;
}
-(NSUInteger)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskAll;
}

But still there is not much expected results.

Question: What makes my B controller will work for all orientations even my Parent A works only for portrite.

Thanks In advance All your suggestions/advice useful on this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:54:34+00:00Added an answer on June 12, 2026 at 8:54 am

    First of all, in AppDelegate, write this. THIS IS VERY IMP

    - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
    {
         return (UIInterfaceOrientationMaskAll);
    }
    

    Then, For UIViewControllers, in which you need only PORTRAIT mode, write these functions

    - (BOOL)shouldAutorotate
    {
        return YES;
    }
    
    - (NSUInteger)supportedInterfaceOrientations
    {
        return (UIInterfaceOrientationMaskPortrait);
    }
    

    For UIViewControllers, which require LANDSCAPE too, change masking to All.

    - (NSUInteger)supportedInterfaceOrientations
    {
        return (UIInterfaceOrientationMaskAllButUpsideDown);
        //OR return (UIInterfaceOrientationMaskAll);
    }
    

    Now, if you want to do some changes when Orientation changes, then use this function.

    - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
    {
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using a UINavigationController in my application. in the first view i am
I have an iPhone app using a UINavigationController. On the fourth controller of the
I have an iPhone application using UINavigationController and would like to customize the elements
im trying to programatically do a UITabBarController using a UINavigationController inside each UIViewController called
I have UINavigationController in my application, at some point I hide NavigationBar using following
Using storyboards you have no easy access to the first view controller in appDelegate
I have in my only-ios5 application a navigationControllerDelegate: - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
I'm using xCode 4.3.2 and started a blank application. I have a navigation controller
I'm using Storyboard first time, and I've created UITabBarController application. I've got 4 UINavigationControllers
In the application I'm trying to develop I have UINavigationController as a root controller.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.