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

  • Home
  • SEARCH
  • 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 3242682
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:20:38+00:00 2026-05-17T18:20:38+00:00

Update: Solved. See fix at bottom. In my iPad app which supports all orientations,

  • 0

Update: Solved. See fix at bottom.

In my iPad app which supports all orientations, if the app is loaded in landscape, weird things happen:

  1. Alert views appear in portrait, even though the rest is in landscape
  2. Rotating the iPad from landscape to portrait does not trigger a rotation (nor does it trigger any of the shouldAutorotate style methods).
  3. Rotating the iPad 180 degrees (to “other landscape”) does trigger rotation, and after this, the iPad behaves like normal (i.e. rotates correctly to portrait and landscape when rotated).

Alert view screen below. Weird, weird. Any ideas why this might be happening? It only happens when loading in landscape — loading in portrait and then rotating to landscape works just fine.
Landtrait!

Solution: This problem occurred because I was adding a UIViewController (modally) on top of the main view controller as soon as the app finished loading (more specifically, in the app’s viewDidAppear: method).

iOS sends a number of (4) shouldAutorotateToInterfaceOrientation: calls to the current/main view controller after things have started up, to figure out which orientations are currently supported. When I added the other VC so soon, this occurred in the middle of the aforementioned calls. Thus, I only got one or two calls (for “portrait”, because it starts with portrait).

The main view controller was then left with a default support of “NO” for the landscape orientations, but the newly added view controller (which is also asked about orientations) now happily responds yes.

If I had removed the other VC (which is in landscape), I would have realized that my main view controller was stuck in portrait. So I had a portrait view, on top of which there was a landscape view. The alerts and such heeded the orientation of the former, hence the disastrous results above.

Additionally, if I tried to rotate to portrait, I couldn’t, because the main view controller was already in portrait. Rotating to landscape was also impossible because the other view controller is already in landscape. Only when I did the “landscape but that other one” rotation, did both view controllers agree that rotation was required, and thus the device rotated.

The fix in my case was to simply put the creation of the other controller at a slight delay. using performSelector:withObject:afterDelay. — 0 seemed to work but I just put it at 1 to be sure. It looks a bit weird, with the main vc appearing and then the other vc, but it’s better than the above.

  • 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-17T18:20:39+00:00Added an answer on May 17, 2026 at 6:20 pm

    This problem occurred because I was adding a UIViewController (modally) on top of the main view controller as soon as the app finished loading (more specifically, in the app’s viewDidAppear: method).

    See above post for details on solution.

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

Sidebar

Related Questions

Update: Solved, with code I got it working, see my answer below for the
[update2] One of those problems I solved & can't remember how... :) [update1] could
Update: Check out this follow-up question: Gem Update on Windows - is it broken?
Update: giving a much more thorough example. The first two solutions offered were right
UPDATE: Focus your answers on hardware solutions please. What hardware/tools/add-in are you using to
Update : Looks like the query does not throw any timeout. The connection is
Update: Now that it's 2016 I'd use PowerShell for this unless there's a really
UPDATE - A comprehensive comparison, updated as of February 2015, can be found here:
UPDATE: Thanks to everyone for the responses. I didn't realize document.write() was deprecated. Add
Update: Thanks for the suggestions guys. After further research, I’ve reformulated the question here:

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.