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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:55:22+00:00 2026-06-07T07:55:22+00:00

This is a rather basic question regarding the return value from a simple UIInterfaceOrientation

  • 0

This is a rather basic question regarding the return value from a simple UIInterfaceOrientation object, I try this code:

- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
BOOL orientacion = interfaceOrientation;
return orientacion;
}

and the conversion does it, so I thought a UIInterfaceOrientation object is equal to a boolean var?? is that a implicit typo or really UIInterfaceOrientation is equal to a boolean value..

  • 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-07T07:55:23+00:00Added an answer on June 7, 2026 at 7:55 am

    UIInterfaceOrientation is an enum, which essentially means it’s an integer. Integers can be assigned to booleans. Many things can–booleans simply equate to true or false. If a boolean is set equal to 0 or nil, it is false. If it is set to anything other than 0 or nil (or some other #defined equivalent) it will be true. Since UIInterfaceOrientation is an enum (an integer), if it is equal to 0 the boolean will be false. If it is anything but 0 it will be true.

    The values of UIInterfaceOrientation:

    typedef enum {
        UIDeviceOrientationUnknown,
        UIDeviceOrientationPortrait,            // Device oriented vertically, home button on the bottom
        UIDeviceOrientationPortraitUpsideDown,  // Device oriented vertically, home button on the top
        UIDeviceOrientationLandscapeLeft,       // Device oriented horizontally, home button on the right
        UIDeviceOrientationLandscapeRight,      // Device oriented horizontally, home button on the left
        UIDeviceOrientationFaceUp,              // Device oriented flat, face up
        UIDeviceOrientationFaceDown             // Device oriented flat, face down
    } UIDeviceOrientation;
    

    The first on this list will equal 0. The next 1, the next 2, etc. So UIDeviceOrientationUnknown will set the boolean to false; anything else will set it to true.


    In any case, you’re not using this function correctly. The code inside this function needs to read:

    if((interfaceOrientation == someOrientationYouWantToWork) || (interfaceOrientation == someOtherOrientationYouWantToWork)
    {
        return YES;
    }
    else
    {
        return NO;
    }
    

    Set someOrientationYouWantToWork etc to values from the enums I posted above. Whichever orientations you want to work, return YES for. Else it will return NO.

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

Sidebar

Related Questions

This is a rather basic question regarding the syntax of the return statement in
This question may seem rather basic, but coming from an engineering (non computer-science) background,
So this is a rather basic question regarding the best way to sort an
Rather basic question here guys. Basically I have code like this: public SuperPanel() {
this is a rather basic question (I'm new to Django) but I'm having trouble
I'm learning jQuery/javascript and have a rather basic question. Why doesn't this work? Thanks
This is a rather basic question, however I'm still struggling with it a little.
Please forgive this rather basic question, but I'm very new to Java and still
Beware, this is a rather basic question (I think). I have a UserControl, called
this is a rather basic java question I have an array containing String that

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.