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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:03:01+00:00 2026-06-15T14:03:01+00:00

I seem to be having difficulties with my iOS Application. It’s deployment target is

  • 0

I seem to be having difficulties with my iOS Application.

It’s deployment target is iOS5.0, however I am using the iOS 6.0 SDK.

In my View Controller I have:

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationMaskPortrait;
}

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
}

This works fine when running in the iOS5 simulator.
The view will not rotate to LandScape or upside down.

However, in the IOS6 Simulator (and on a Device), it will continue to rotate.

I have used NSLog to check that -supportedInterfaceOrientations does get called and it does, twice, however it still rotates to LandScape (right or left)

What am I doing wrong?

I’ve also extended the UINavigationController (My Root View Controller) to include this:

@implementation UINavigationController (Rotation_IOS6)

-(BOOL)shouldAutorotate
{
    return [[self.viewControllers lastObject] shouldAutorotate];
}

-(NSUInteger)supportedInterfaceOrientations
{    
    return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}

@end

But with still no success.

Edit

As per matt’s answer. I also needed to extend the UITabBarController with a similar implementation to my UINavigationController and that worked.

  • 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-15T14:03:02+00:00Added an answer on June 15, 2026 at 2:03 pm

    The problem could be that you have a navigation interface. Do you? If so, you need to subclass UINavigationController and use an instance of that subclass as your navigation controller. In that subclass, that is where you implement supportedInterfaceOrientations. So too for any parent view controller (e.g UITabBarController).

    The reason is that the iOS 6 way of thinking about rotation is completely different from iOS 5. Nothing you think you know from iOS 5 applies any more. In iOS 6 we start at the level of the application itself and work our way down by way of the app delegate to the root view controller or other full screen view controller (e.g. a presented view controller) and stop. A parent no longer consults its children.

    Moreover, the application itself (by way of the info.plist or the app delegate) must list every orientation that any part of the application can ever assume; view controllers can only ask for a subset of those.

    See the release notes:

    http://developer.apple.com/library/ios/#releasenotes/General/RN-iOSSDK-6_0/_index.html

    However, note that this sentence is a lie:

    For compatibility, view controllers that still implement the shouldAutorotateToInterfaceOrientation: method do not get the new autorotation behaviors

    On the contrary, in iOS 6 the older autorotation methods are ignored completely; everybody gets the new autorotation behaviors. It is not “opt-in”.

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

Sidebar

Related Questions

I seem to be having difficulties using jQuery .animate() to animate an absolutely positioned
i seem to be having difficulties in accessing and comparing objects in NSMutableArrays in
I seem to be having difficulties adding a mask via CALayers. I'm simply trying
I'm having some difficulties with the PathCombine function. It does not seem to work
I am using the MVC model with WPF, and am having difficulties with the
I seem to be having some difficulties with retrieving data from Mysql. I tried
I seem to be having problems with my java gui code, and I have
I SEEM to be having an issue with GlobalLock in my application. I say
I am having difficulties on plotting time on the xaxis. I have some overlapping
I seem to be having issues with using find() with the STL map on

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.