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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:48:58+00:00 2026-05-16T20:48:58+00:00

I just want to ask if anybody else is also having problems with this;

  • 0

I just want to ask if anybody else is also having problems with this;

It used to be that a tabbar app by default didn’t allow landscape view unless it was enabled for all views in the app, but one could add

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotateFromInterfaceOrientation) name:@"UIDeviceOrientationDidChangeNotification" object:nil];

to catch the orientation change messages & then react to the messages accordingly.

Lately I’ve seen that once a landscape view has been shown, every view that does not allow landscape will show that previous landscape view when the phone is tilted.

So,
View1 (does not support landscape) tilted phone shows View1 sideways,
View2 (supports landscape) tilted phone shows Landscapeview2,
now that the landscape view has show once,
View1 tilted shows Landscapeview2

I release the viewcontroller after presentModalViewController and dismiss the viewcontroller when the landscape view is no longer needed so it should be gone but on any orientation change after the first display it keeps showing, as if presentModalViewController was being called again.

Any ideas? Anybody else having the same problem? (It never happened with the 3.x OS versions)

  • 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-16T20:48:59+00:00Added an answer on May 16, 2026 at 8:48 pm

    For anybody interested;
    It seems the landscape enabled view controller was staying as observer for orientation changes even when it was not the active view anymore, basically it was answering to changes for every view.

    My solution was to create 2 new BOOL’s, 1 called isActiveView and 1 called isShowingLandscape, and used those to ensure that the view controller only responded when it or it’s landscape view were being shown.

    Relevant code is:

    -(void)viewDidAppear:(BOOL)animated
    {
      isActiveView = TRUE;
    }
    
    -(void)viewDidDisappear:(BOOL)animated
    {
      isActiveView = FALSE;
    }
    
    -(void)didRotateFromInterfaceOrientation
    {
      if ((orientation == UIDeviceOrientationPortrait) && ((isActiveView) || (showingLandscape)))
      {
        [self dismissModalViewControllerAnimated:YES];
        showingLandscape = FALSE;
      }
      else if ((orientation == UIDeviceOrientationLandscapeLeft) && (isActiveView))
      {
        LandscapeViewController *landscapeViewControllerObject = [[LandscapeViewController alloc] initWithNibName:@"LandscapeView" bundle:[NSBundle mainBundle]];
        [self presentModalViewController:landscapeViewControllerObject animated:YES];
        [landscapeViewControllerObject release];
        showingLandscape = TRUE;
      }
      else if ((orientation == UIDeviceOrientationPortraitUpsideDown) && ((isActiveView) || (showingLandscape)))
      {
        [self dismissModalViewControllerAnimated:YES];
        showingLandscape = FALSE;
      }
      else if ((orientation == UIDeviceOrientationLandscapeRight) && (isActiveView))
      {
        LandscapeViewController *landscapeViewControllerObject = [[LandscapeViewController alloc] initWithNibName:@"LandscapeView" bundle:[NSBundle mainBundle]];
        [self presentModalViewController:landscapeViewControllerObject animated:YES];
        [landscapeViewControllerObject release];
        showingLandscape = TRUE;
      }
    }
    

    Hope this helps anybody else having the same problems.

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

Sidebar

Related Questions

Just want to ask the gurus out there about this. I know that CSS
I just want to ask, I know that standart system calls in Linux are
I just want to ask how should I put my image (dynamically) in this
I just want to ask that how do i add html suffix to each
just want to ask anyone here can solve this problem? I want to create
I just want to ask, how to prove that hibernate is doing lazy loading
I just want to ask for your experience. I'm designing a public website, using
I don't know too much about encryption, I just want to ask, which method
Just want to know if there other optional wrapper framework available that generate client
I just want my apache to register some of my predefined environment so that

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.