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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:43:08+00:00 2026-06-13T09:43:08+00:00

I’m trying to update my app for iOS 6, and the main challenge is

  • 0

I’m trying to update my app for iOS 6, and the main challenge is handling autorotation. There are questions and search results that relate to this topic, but none that answer my question directly. I understand the deprecation of shouldAutorotateToInterfaceOrientation: and its replacement with supportedInterfaceOrientations and shouldAutorotate – this question doesn’t directly concern those.

Instead I’m interested in knowing how I can replace willAutorotateToInterfaceOrientation:duration:, which is where my app handles almost all of its rotation animation and layout restructuring. My main view controller controls a full-screen view that is added to the main window on launch and which deals with the entire internal layout of the app, which is somewhat complicated. The willAutorotateToInterfaceOrientation:duration: method in this view controller resizes some subviews directly and calls through to C++ objects that handle other subviews. Because of the variable nature of the interface, which includes a complex hierarchy of subviews, some that do not resize, some that are offscreen, and so on, I do not think Apple’s autoresizing masks offer a powerful enough solution to handle this sort of autorotation.

Is there some way to take action in the same way that I do in willAutorotateToInterfaceOrientation:duration: now? As I’ve found online and by experimentation, this method and didRotateFromInterfaceOrientation: are never called in my main view controller in iOS 6. I’ve also found that viewWillLayoutSubviews is never called, although I suspect that it wouldn’t quite meet my needs anyway.

Please let me know if you need any further information. I hope there is a fairly straightforward solution to this and this is not an example of Apple abandoning developers to the wolves if they don’t conform to a new, narrower protocol.

Edit: In case this helps to clarify, here’s a basic shell of the functionality I’m talking about:

In AppDelegate.mm:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    [self.window makeKeyAndVisible];
    MainViewController* mainViewController= [[MainViewController alloc] initWithNibName:nibName bundle:[NSBundle mainBundle]];
    [self.window addSubview:mainViewController.view];
    return YES;
}

In MainViewController.mm:

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {

    [UIView beginAnimations:NULL context:nil];
    [UIView setAnimationDuration:duration];
    [someViewController someMethod];
    [someView setFrame:someRect];
    [UIView commitAnimations];

    someObject->CustomRotationFunction( toInterfaceOrientation, duration );
}

Generally speaking, assume the worst about what goes on in these functions and methods, e.g. someObject owns views which change their frames, it owns other objects which own views which change their frames, etc.

  • 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-13T09:43:08+00:00Added an answer on June 13, 2026 at 9:43 am

    Your main problem is that you’re just adding your ViewController’s view to the window instead of setting it as the rootViewController. That’s the reason why the willRotateToInterfaceOrientation, didRotateToInterfaceOrientation and so on are never called in iOS6.

    In iOS5, the shouldAutorotateToInterfaceOrientation was passed to every childViewController of the ViewController that was on the window which could then return whether or not you wanted to rotate. In iOS6, the rootViewController decides whether or not your application supports a certain orientation. So you NEED to set a rootViewController in iOS6 and it is best practice to do so in earlier iOS versions as well. The methods you need will then be called at the correct times and will be passed to any childViewControllers.

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
        [self.window makeKeyAndVisible];
        MainViewController* mainViewController= [[MainViewController alloc] initWithNibName:nibName bundle:[NSBundle mainBundle]];
        self.window.rootViewController = mainViewController;
        return YES;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there's a lot of other questions out there that deal with this
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:

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.