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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:36:49+00:00 2026-06-15T21:36:49+00:00

Am using iOS6 device xcode 4.5 & mountain lion mac. And in my app

  • 0

Am using iOS6 device xcode 4.5 & mountain lion mac.
And in my app am starting in portrait mode(3 screens).
But 4th screen should be in landscape and should support landscape left & landscape right.

Most of the explanations are shown how to rotate.

in appddelegate am using

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
      UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
navigationController.navigationBar.tintColor = [UIColor blackColor];


// Set RootViewController to window
if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0)
{
    // warning: addSubView doesn't work on iOS6
     [self.window addSubview: navigationController.view];
}   
else
{
     // use this mehod on ios6
     [self.window setRootViewController:navigationController];
}

}
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    if(self.shouldRotate ) //shouldRotate is my flag
    {
         self.shouldRotate = NO;
         return (UIInterfaceOrientationMaskLandscapeRight);
    }
    return (UIInterfaceOrientationMaskPortrait);
}

and in my view controller which should be landscape and am using

 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self)
    {
         appDelegate.shouldRotate = YES;
        // Custom initialization
    }
     return self;
 }



- (BOOL)shouldAutorotate
{
     return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
      return UIInterfaceOrientationMaskLandscape;
}

In my viewcontrollers which are potrait are working correctly in which am using

- (BOOL)shouldAutorotate
{
     return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
      return UIInterfaceOrientationMaskPortrait;
}

can any one suggest to do this

Thanks in advance

  • 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-15T21:36:50+00:00Added an answer on June 15, 2026 at 9:36 pm

    This is working for me
    I removed NavigationController and changed as follows

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
        if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
        {
            self.viewController = [[PlashViewController alloc] initWithNibName:@"PlashViewController" bundle:nil];
        }
        self.window.rootViewController = self.viewController;
       [self.window makeKeyAndVisible];
       return YES;
    }
    

    im my app am placed this methods in my view controllers as follows
    and in plist and target i specified three orientations like portrait , landscapeleft and landscaperight
    to show view in portrait

    -(BOOL)shouldAutorotate
    {
        return YES;
    }
    
    -(NSUInteger)supportedInterfaceOrientations
    {
        return UIInterfaceOrientationMaskPortrait;
    }
    

    to show view in landscape

     - (BOOL)shouldAutorotate
    {
        return YES;
    }
    
    -(NSUInteger)supportedInterfaceOrientations
    {
       return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running the iOS6 SDK on my mac running Xcode 4.2 on Snow
I'm developing an iOS App which targets iOS 5.1+. I'm using XCode 4.5 on
Is there any generic way to detect iOS6 device using feature detection.
I have an iPad app, built in XCode4.5, using Storyboards and iOS6. I have
I have an iPad app, using XCode 4.5, Storyboards, UITabBarController and iOS 6. I
A new iOS6 configuration profile reference defines a new App Lock Payload . It
I'd like to open maps on ios6 by usine MKMapItem but I'd also like
I'm experiencing some strange behavior when using tableviews in iOS6. I see they've added
I have done routing in iOS apps before, but with iOS6 we are now
In iOS6, I am using autolayouts. I have 2 views v1 and v2 programatically

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.