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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:27:36+00:00 2026-05-28T01:27:36+00:00

I have a universal application created in storyboard mode. It is set-up to automatically

  • 0

I have a universal application created in storyboard mode. It is set-up to automatically rotate to the current orientation. I have attempted to disable some orientations in iPhone-mode but it does not work when I test in the simulator.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
    return ((interfaceOrientation != UIInterfaceOrientationLandscapeRight) || (interfaceOrientation != UIInterfaceOrientationLandscapeLeft));
} else {
    return YES;
}
}

Also, when the iPad is rotated, it should go through the following code BUT all I get is a black screen.

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
    if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
        self.view = landscape;
        self.view.transform = CGAffineTransformMakeRotation(deg2rad*(90));
        self.view.bounds = CGRectMake(0.0, 0.0, 1024.0, 748.0);
    } else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
        self.view = landscape;
        self.view.transform = CGAffineTransformMakeRotation(deg2rad*(-90));
        self.view.bounds = CGRectMake(0.0, 0.0, 1024.0, 748.0);
    } else {
        self.view = portrait;
        self.view.transform = CGAffineTransformMakeRotation(0);
        self.view.bounds = CGRectMake(0.0, 0.0, 768.0, 1004.0);
    }
} else {

}
}

Why are all these problems arising here? I have tried the code in different Xcode projects without storyboards ad it works fine. What is going on and how can I fix 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-05-28T01:27:37+00:00Added an answer on May 28, 2026 at 1:27 am

    You should create two separate stackoverflow questions. I will answer your first question here.

    Consider this line from your code:

    return ((interfaceOrientation != UIInterfaceOrientationLandscapeRight) || (interfaceOrientation != UIInterfaceOrientationLandscapeLeft));
    
    • If the orientation is Right, then your code reduces to return (Right != Right) || (Right != Left), which always returns true.

    • If the orientation is Left, then your code reduces to return (Left != Right) || (Left != Left), which always returns true.

    • If the orientation is Up, then your code reduces to return (Up != Right) || (Up != Left), which always returns true.

    • If the orientation is Down, then your code reduces to return (Down != Right) || (Down != Left), which always returns true.

    It’s not clear which orientations you want to allow and which you want to exclude. If you want to allow only portrait orientations, do this:

    return UIInterfaceOrientationIsPortrait(interfaceOrientation);
    

    If you want to allow only landscape orientations, do this:

    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
    
    • 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 window based application in xcode 4. Additionally I created
I have made my application universal for iPhone and iPad (window-based application; universal) from
Im converting an Iphone app to a universal App, I have created an Ipad
I am having a problem using the Unity Application Block, I have created a
I have a universal binary application and currently working on the iPad version of
I have an universal application that plays movies from the internet. It has to
I have an universal application which plays several imbedded movies. All works fine on
I have the universal application both for iPhone and iPad. I need to have
I have recently converted my IPad application into a Universal Application. I am re-using
Everybody.. I have create one universal application.. My app worked fine to only two

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.