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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:52:48+00:00 2026-06-16T12:52:48+00:00

In FirstViewController there is a button. After it is pressed, there is a modal

  • 0

In FirstViewController there is a button. After it is pressed, there is a modal segue that goes to SecondViewController. FirstViewController is Portrait, and SecondViewController is Landscape. In the storyboard file, I set SecondVC to Landscape but the iOS Simulator won’t automatically change it’s orientation.
Can someone help me find code that automatically turns SecondViewController from Portait to Landscape?

viewDidLoad statement in SecondVC:

-(void)viewDidAppear:(BOOL)animated  {
    UIDeviceOrientationIsLandscape(YES);
    sleep(2);
    santaImageTimer = [NSTimer scheduledTimerWithTimeInterval:0.5
                                                       target:self
                                                     selector:@selector(santaChangeImage)
                                                     userInfo:NULL
                                                      repeats:YES];
    [santaImageTimer fire];
    image1 = YES;
}

Any help appreciated.

  • 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-16T12:52:49+00:00Added an answer on June 16, 2026 at 12:52 pm

    Sadly, while your attempt to call UIDeviceOrientationIsLandscape(YES); was a valiant attempt, that doesn’t actually change orientation. That method is used to confirm whether a variable holding a orientation is landscape or not.

    For example, UIInterfaceOrientationIsLandscape(toInterfaceOrientation) will return TRUE if the toInterfaceOrientation holds a landscape orientation, and FALSE if not.

    The correct technique for changing orientation is outlined in Handling View Rotations in the UIViewController Class Reference. Specifically, in iOS 6, you should:

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

    In iOS 5, the necessary method is:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
    {
        if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation))
            return YES;
        else
            return NO;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIViewController (firstViewController) which has a button that 'segue's to another UIViewController
In my FirstViewController , there is an IBAction that call to SecondViewController . SecondViewController
I have two UIViewControllers.In the firstViewController,there is a button ,the button action is SecondViewController
In my project, there are two view controllers - let's say firstViewController and secondViewController.
In my app there is a requirement that it should display a specific landscape
Firstly, I use storyboard to create two uiviewcontroller: firstviewcontroller and secondviewcontroller . And using
I've created an app that contains 4 viewcontroller and its .h,.m files...In my firstviewcontroller
I have two view controllers name RootViewController and SecondViewController. In the FirstViewController I have
In firstViewController, SecondViewController *secondViewController = [[[SecondViewController alloc] init] autorelease]; // Pass data to secondViewController
Hi i have two view controller: FirstViewController and SecondViewController FirstViewController.h #import <UIKit/UIKit.h> @interface FirstViewController:

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.