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 9082803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:38:30+00:00 2026-06-16T20:38:30+00:00

In my universal app i need to handle different orientation for iphone and ipad.

  • 0

In my universal app i need to handle different orientation for iphone and ipad. For ipad i need to allow landscape orientation and for iphone portrait alone. I have returned below code at first

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
        return UIInterfaceOrientationIsPortrait(interfaceOrientation);

    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

is working fine in IOS 5 But in IOS 6 autorotate method is not at all fired. After that i have changed the method to,

-(BOOL)shouldAutorotate
{
    return NO;
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskAll;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationMaskPortrait;
}

even this methods are not at all fired in IOS 6.

My plist setting is

enter image description here

i need to handle both orientation [iPhone-portrait,iPad-landscape] for both IOS 5 and IOS 6. Please guide me to fix this issue.

  • 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-16T20:38:31+00:00Added an answer on June 16, 2026 at 8:38 pm

    Is your rootviewcontroller a UINavigation controller or UITabbarcontroller??
    If so these methods wont work if you are calling these methods in your view controller.

    So create an objective C category on these container view controllers and add to your project.

    @implementation UINavigationController (autorotate)
    
    
     -(NSUInteger)supportedInterfaceOrientations
     {
       //make the check for iphone/ipad here
    
    if(IPHONE)
        {
    return UIInterfaceOrientationMaskPortrait;
        } 
    else
        {
    return UIInterfaceOrientationMaskLandscape;
        }
    
     }
    
     - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
     {
    return UIInterfaceOrientationPortrait;
     }
    
     - (BOOL)shouldAutorotate
     {
    return NO;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a universal app for iPhone & iPad. I have a confusion
I have a Universal app (iPhone/iPad) which has an iAd displayed at the bottom
I have a universal app for ipad and iphone. What I'm trying to determine
I have a Universal app that has a different static background image for iPhone
I have just made my app universal by combining separate iPhone and iPad projects.
I am using APNS service in my universal app (iPhone/iPad) and i am not
I have finished developing a big and heavy app. It is universal (for iPhone
Possible Duplicate: Merging existing iPhone and iPad app ids into a single universal app
I'm trying to do the basics steps of creating a universal (iphone/ipad) app in
I just updated our app to an universal app for iPhone and iPad. I

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.