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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:08:02+00:00 2026-06-10T12:08:02+00:00

Why UIInterfaceOrientation always returns to the right? When I finish rotate, always ends on

  • 0

Why UIInterfaceOrientation always returns to the right?
When I finish rotate, always ends on the right, why?
PS: I just want to landscape

Here is the code

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    switch (interfaceOrientation)
    {
       case UIInterfaceOrientationLandscapeLeft:
          NSLog(@"Is Left");
       case UIInterfaceOrientationLandscapeRight:
          NSLog(@"Is Right");
       default: ;
    }

    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    switch (fromInterfaceOrientation)
    {
        case UIInterfaceOrientationLandscapeLeft:
          NSLog(@"From Left");
        case UIInterfaceOrientationLandscapeRight:
          NSLog(@"From Right");
        default: ;
    }
}

Here is the LOG

2012-08-23 17:45:28.074 Simulador 360[323:707] Is Right
2012-08-23 17:45:28.126 Simulador 360[323:707] Is Right
2012-08-23 17:45:28.131 Simulador 360[323:707] Is Left
2012-08-23 17:45:28.132 Simulador 360[323:707] Is Right
2012-08-23 17:45:28.138 Simulador 360[323:707] Is Left
2012-08-23 17:45:28.140 Simulador 360[323:707] Is Right
2012-08-23 17:45:31.160 Simulador 360[323:707] Is Right
2012-08-23 17:45:31.167 Simulador 360[323:707] Is Right
2012-08-23 17:45:31.977 Simulador 360[323:707] From Left
2012-08-23 17:45:31.980 Simulador 360[323:707] From Right
2012-08-23 17:45:35.684 Simulador 360[323:707] Is Left
2012-08-23 17:45:35.687 Simulador 360[323:707] Is Right
2012-08-23 17:45:35.691 Simulador 360[323:707] Is Left
2012-08-23 17:45:35.693 Simulador 360[323:707] Is Right
2012-08-23 17:45:36.502 Simulador 360[323:707] From Right
  • 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-10T12:08:04+00:00Added an answer on June 10, 2026 at 12:08 pm

    You are missing breaks in your switch statements. Without calling break, execution will continue through to the next case, so if your case if the interface orientation evaluates to Left, both Left and Right case blocks will be executed.

    Fix this by inserting break at the end of each of your cases:

    switch (interfaceOrientation)
    {
       case UIInterfaceOrientationLandscapeLeft:
          NSLog(@"Is Left");
          break;
       case UIInterfaceOrientationLandscapeRight:
          NSLog(@"Is Right");
          break;
       default: ;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set my iPad app to Landscape mode using following code.. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
Hi I have this piece of code... - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } and
I have a tab bar controller with this code - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return
I have this code: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } -(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
My application doesn't oriented even if I use - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Override to
Can anyone explain me what's going on? I use this method - (BOOL)shouldAutorotateToInterfaceOrientation:( UIInterfaceOrientation)interfaceOrientation
how to run the following method - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {} from another method? (so new
I have a viewController and I have - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } why
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{ return YES; } - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { [self positionViews]; } -(void)positionViews { UIInterfaceOrientation
I Have implemented - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } in all of my controllers.

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.