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

  • Home
  • SEARCH
  • 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 6859097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:14:28+00:00 2026-05-27T02:14:28+00:00

I need to get interface orientation in appDidBecomeActive:(UIApplication *)application [application statusBarOrientation]; but if the

  • 0

I need to get interface orientation in appDidBecomeActive:(UIApplication *)application

[application statusBarOrientation];

but if the app starts from closed(ie not resumed from background), this always returns portrait, it works when resumed from background.

Also, I tried to use UIDevice orientation along with status bar orientation, but UIDevice orientation may not be the interface orientation.

So is there any way to get interface orientation in app delegate, appDidBecomeActive?

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-05-27T02:14:29+00:00Added an answer on May 27, 2026 at 2:14 am

    What you need to do is handle this in your splash view controller. You can use a combination interfaceOrientation, shouldAutorotateToInterfaceOrientation, didAutorotateToInterfaceOrientation, etc.

    Essentially, create a view controller that you will have as your root view controller. In there, determine the orientation changes in shouldAutorotateToInterfaceOrientation (it will always be portrait or landscape in viewDidLoad depending on your xib, so don’t do it there). Do your image display with an NSTimer or whatever. After the timer, show your regular app screens.

    You can’t display the image until you have a view controller anyway, so you must wait until a view controller gives you the interfaceOrientation changes. You should focus on that first view controller, not the app delegate.

    AppDelegate.h

    #import <UIKit/UIKit.h>
    
    @class SplashViewController;
    @interface AppDelegate : UIResponder <UIApplicationDelegate>
    
    @property (retain, nonatomic) IBOutlet UIWindow *window;
    @property (retain, nonatomic) SplashViewController *splashController;
    
    -(void)showSplash;
    @end
    

    AppDelegate.m

    #import "AppDelegate.h"
    #import "SplashViewController.h"
    
    @implementation AppDelegate
    @synthesize window = _window, splashController = _splashController;
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        [self showSplash];
        [self.window makeKeyAndVisible];
        [self performSelector:@selector(registerBackground) withObject:nil afterDelay:5.0];
        return YES;
    }
    
    -(void)showSplash
    {
        SplashViewController *splash = [[SplashViewController alloc] initWithNibName:@"SplashViewController" bundle:nil];
        [self.window addSubview:splash.view];
        self.splashController = splash;
        [splash release];
        //have to add a delay, otherwise it will be called on initial launch.
        [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(removeSplash:) userInfo:nil repeats:NO];
    
    }
    
    -(void)registerBackground
    {
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(returnFromBackground:)
                                                     name:UIApplicationDidBecomeActiveNotification
                                                   object:nil];
    }
    
    -(void)returnFromBackground:(NSNotification *)notification
    {
        [self showSplash];
    }
    
    -(void)removeSplash:(NSTimer *)timer
    {
        [self.splashController.view removeFromSuperview];
        self.splashController = nil;
    }
    
    
    - (void)dealloc
    {
        [_window release];
        [_splashController release];
        [super dealloc];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to interface an existing application with Acegi/Spring security. In order to get
I need to get an Android app to interface with an XML webservice (it's
I need to get information from the third-party application using Cocoa Accessibility API. The
We need to get all the instances of objects that implement a given interface
Just need get some vals located in application.ini(main ini) in the Controller plugin I
I need to get the default printer name. I'll be using C# but I
I need to get a regular snapshot from a webcam in Delphi. Speed is
There's something fundamental that I'm not understanding about presenting views that get their interface
I need to get all the objects in my application that implement a given
I need to get system and hardware info via a Java application. I'm interested

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.