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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:35:56+00:00 2026-06-12T16:35:56+00:00

As far as I know the correct practice on iOS 6 is to write

  • 0

As far as I know the correct practice on iOS 6 is to write a code like this to handle autorotation:

// iOS 6
- (BOOL)shouldAutorotate {
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}

Instead of writing

// pre-iOS 6 support
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    BOOL retVal = UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
    return retVal;
}

To be honest, I think that the pre-iOS 6 is much more clear: I don’t understand the point of having 2 methods to handle autorotation, specially because I’ve seen -(BOOL) shouldAutorotate returning YES in all the examples. Am I missing something?

  • 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-12T16:35:58+00:00Added an answer on June 12, 2026 at 4:35 pm

    The new API lets you save a call to get the current device orientation: the two questions, namely

    • Whether or not the application should auto-rotate, regardless of the new orientation, and
    • What are the orientations a device supports

    are most often answered statically, without making a call to check the current orientation. The savings become more important when a screen has multiple views controlled by separate view controllers.

    Since the iOS is making a call into your app’s shouldAutorotate in response to an event from the accelerometer, it already knows the new orientation; if your app answers ‘YES`, the iOS could then check the current orientation against the list of supported ones, and come up with a decision without your app querying for the current orientation.

    In the unlikely case that your app needs to decide on auto-rotation based on the new orientation, the new API is no worse than the old one, so it’s a “win-draw” situation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to following code and as far as I know it is correct,
As far as I know, I put in the correct try catch statements to
As far as I know, I'm following the correct usage form on: http://api.jquery.com/multiple-attribute-selector/ ,
As far as I know, impure functions are those which do not always return
First, I would like to make sure I got the structure correct. As far
As far as I know (correct me if I'm wrong), in ODBC table names
As of XSLT 2.0, as far as I know (correct me if I’m wrong),
As far as I know,any programming language which doesn't require to write type annotations
So far I know that FileSystemWatcher can look into a folder and if any
As far as know, I must be careful with PHP, and I think Javascript.

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.