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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:58:51+00:00 2026-06-15T23:58:51+00:00

this issue is supposed to be a simple one… i have googled a lot

  • 0

this issue is supposed to be a simple one…
i have googled a lot about it and i have tried all the setups on my project.
the thing is i am working on a project that is not mine. the app launched from the app delegate and then i am adding aUIViewController (without XIB file) everything done by code.
the ViewController is actually on landscape, but the thing is the the app is running on portrait (when i am pulling the notification view it turns dow like in the portrait mode).

this is implemented in the AppDelegate.m file:

- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationLandscapeRight;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
 // Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
 }



- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{                                                                                                     

 return UIInterfaceOrientationMaskLandscapeRight|UIInterfaceOrientationMaskLandscapeLeft|UIInterfaceOrientationMaskPortrait; 

 //if i am writing only the landscape right orientation the app crashes!



}

* Terminating app due to uncaught exception ‘UIApplicationInvalidInterfaceOrientation’, reason: ‘Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES’
*
First throw call stack:
(0x3bfef2a3 0x35ede97f 0x3bfef1c5 0x3518988f 0x3532e579 0x3520dd3d 0x3520cfc7 0x3532f257 0xa5bc1 0x35188319 0x351a4f0f 0x351a4e97 0x3512aa33 0x3bfc46cd 0x3bfc29c1 0x3bfc2d17 0x3bf35ebd 0x3bf35d49 0x3a3032eb 0x351752f9 0x9803b 0x97fe0)
libc++abi.dylib: terminate called throwing an exception

if i am writing it with the portrait mode the app launches. i have also tried to add row in the info.plist and set the key to initial interface orientation value to the landscape (right home button).
also put the supported interface orientation to lanscape as well.
non of this change anything, i just want to know how i can get that behavior to get the notification from above in the landscape mode

Anyone, thanks!

  • 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-15T23:58:52+00:00Added an answer on June 15, 2026 at 11:58 pm

    Try this way in your app delegate .m file …

        #define IOS_OLDER_THAN_6 ( [ [ [ UIDevice currentDevice ] systemVersion ] floatValue ] < 6.0 )
        #define IOS_NEWER_OR_EQUAL_TO_6 ( [ [ [ UIDevice currentDevice ] systemVersion ] floatValue ] >= 6.0 )
    
    
    
            - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
            {
    
    
                self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    
                [NSThread sleepForTimeInterval:0.1]; // simulate waiting for server response
    
                // Override point for customization after application launch.
    
                self.viewController = [[[ViewController alloc] init] autorelease];
    
                // Initialise the navigation controller with the first view controller as its root view controller
    
                UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
    
                // This is where we hide the navigation bar! :)
    
                [navigationController setNavigationBarHidden:NO];
    
                // Navigation controller has copy of view controller, so release our copy
    
    
                   [self.viewController release];
    
                // Add the navigation controller as a subview of our window
    
                if ([[UIDevice currentDevice].systemVersion floatValue] < 6.0)
                {
                    // how the view was configured before IOS6
                    [self.window addSubview: navigationController.view];
                   // [self.window makeKeyAndVisible];
                }
                else
                {
                    // this is the code that will start the interface to rotate once again
            //        [self.window setRootViewController: self.navigationController];
                    [self.window setRootViewController:navigationController];
                }
    
            //    [self.window setRootViewController:navigationController];
                [_window makeKeyAndVisible];
                return YES;
            }
    
    
        #ifdef IOS_OLDER_THAN_6
        - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
           // [image_signature setImage:[self resizeImage:image_signature.image]];
            return (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft | toInterfaceOrientation == UIInterfaceOrientationLandscapeRight);
        }
        #endif
    
        #ifdef IOS_NEWER_OR_EQUAL_TO_6
        -(BOOL)shouldAutorotate {
            return YES;
        }
        - (NSUInteger)supportedInterfaceOrientations {
           // [image_signature setImage:[self resizeImage:image_signature.image]];
            //return UIInterfaceOrientationMaskLandscapeLeft;
            return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
        }
        #endif
    
        - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
        {
            return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
        }
    

    **`

    And also Write down the this code in your all view controller .m file

    `**

    #define IOS_OLDER_THAN_6 ( [ [ [ UIDevice currentDevice ] systemVersion ] floatValue ] < 6.0 )
    #define IOS_NEWER_OR_EQUAL_TO_6 ( [ [ [ UIDevice currentDevice ] systemVersion ] floatValue ] >= 6.0 )
    
    
    #ifdef IOS_OLDER_THAN_6
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
       // [image_signature setImage:[self resizeImage:image_signature.image]];
        //return (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft | toInterfaceOrientation == UIInterfaceOrientationLandscapeRight);
        if(toInterfaceOrientation ==UIInterfaceOrientationLandscapeLeft){
            NSLog(@"Changed Orientation To Landscape left");
    
            return (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft);
    
        }else{
            NSLog(@"Changed Orientation To Landscape right");
            return (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight);
        }
    }
    #endif
    
    #ifdef IOS_NEWER_OR_EQUAL_TO_6
    -(BOOL)shouldAutorotate {
        return YES;
    }
    - (NSUInteger)supportedInterfaceOrientations {
      //  [image_signature setImage:[self resizeImage:image_signature.image]];
        //return UIInterfaceOrientationMaskLandscapeLeft;
        return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
    }
    #endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note: This issue appears to be limited to SQL Server 2005 SP2 I have
I tried Google this issue and was searched over an hour on Stackoverflow, but
This seems like a fairly simple problem to me but I have been having
I have this simple Select box that is suppose to store the selected value
So I have this simple PHP loop that is generating html table data with
I'm hoping this will be a simple answer for one of you. We've got
I'm having a (probably super simple) issue. The code below is supposed to _POST
I have googled it a lot and found that usually it cannot be done.
I read up on this article about Perlin Noise and have a few questions
This issue has been on/off bugging me and I've written 4 wrappers now. I'm

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.