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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:16:36+00:00 2026-05-15T02:16:36+00:00

OK, knowledgeable programmer-types, please be gentle… I’m having trouble getting a very simple, one-view

  • 0

OK, knowledgeable programmer-types, please be gentle…

I’m having trouble getting a very simple, one-view “Hello World” app to rotate automatically. I go through the usual “Hello World” steps:

  • Create a new View-based project.
  • Double-click on the .xib file for the ViewController.
  • Add a item from the Library. I’ve tried a Label as well as a Slider.
  • Change the Struts and Springs to just Springs to keep the item in the middle of the view.
  • Save and then edit the .m file for the ViewController so that it reads:
  • /*
    // Override to allow orientations other than the default portrait orientation.
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        // Return YES for supported orientations
        return YES;
    }
    */
    

    (Um… Duh. I just saw it. But I will continue with my story for your amusement.)

  • Save, build, run, rotate, and notice that nothing rotates when I rotate the iPhone simulator. And, no, I didn’t rotate my laptop… I used the keyboard shortcuts!

    Frustration set in after about an hour of Googling for the answer. Everywhere I looked, each source said the same thing: Just change the return value to “yes”. And yet…

    I even stuck debugger breakpoints in! None of them were hit! (Shock, surprise!) Figuring that I didn’t know how to use the debugger, I stuck a breakpoint in on “initWithNibName.” Guess what?! That didn’t get hit, either! What the… heck?!

    So I downloaded Apple’s WhichWayIsUp app to test my breakpoint l33t breakpoint skilz. Sure enough, it beeps away as I rotate the “iPhone” around. So what am I doing wrong?!

    Surely, I’m not that ignorant that I… no, wait, I take that back. If you saw my error, above, then you are certainly thinking, “Yes, he is that ignorant.” And you’re right.

    For those of you who stumbled across this question, are similarly frustrated, and didn’t see the problem yet, here’s the answer: the entire shouldAutorotateToInterfaceOrientation method is encapsulated by “/* */” comment tokens. It never got compiled, much less called.

    Now, that I know of, none of the sources that I found make it obvious that you have to ensure that the code block is uncommented. Several say, “All you have to do is change exactly one line of code.” And, except for those other two with the comment tokens on them, they’re exactly right.

    If I just helped some other n00b, then great. If I made you laugh at my fail, then that’s even better.

    Thanks, everybody, for your help!

    • 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-15T02:16:36+00:00Added an answer on May 15, 2026 at 2:16 am

      The answer is in the question, namely that the shouldAutorotateToInterfaceOrientation method is enclosed by comment tokens. Removing the “/*” and “*/” which precede and follow the method solved the problem.

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

    Sidebar

    Ask A Question

    Stats

    • Questions 422k
    • Answers 422k
    • Best Answers 0
    • User 1
    • Popular
    • Answers
    • Editorial Team

      How to approach applying for a job at a company ...

      • 7 Answers
    • Editorial Team

      What is a programmer’s life like?

      • 5 Answers
    • Editorial Team

      How to handle personal stress caused by utterly incompetent and ...

      • 5 Answers
    • Editorial Team
      Editorial Team added an answer Once you've put your data into the array, you could… May 15, 2026 at 11:25 am
    • Editorial Team
      Editorial Team added an answer I don't think there is a way to return to… May 15, 2026 at 11:25 am
    • Editorial Team
      Editorial Team added an answer From my understanding, these are side effects from different parts… May 15, 2026 at 11:25 am

    Trending Tags

    analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

    Top Members

    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.