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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:11:54+00:00 2026-05-23T14:11:54+00:00

Is there a delegate that will get called when the iPhone enters landscape or

  • 0

Is there a delegate that will get called when the iPhone enters landscape or portrait mode? I need to change the style and place objects in a different place when the iPhone get’s rotated. Do I have to do this with the accelerometer? Moreover if there exist such a delegate do I have to create the connection in interface builder. I am new to objective-c…

  • 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-23T14:11:55+00:00Added an answer on May 23, 2026 at 2:11 pm

    Register to listen for the orientation change notification.

    UIDevice *device = [UIDevice currentDevice];
        //Tell it to start monitoring the accelerometer for orientation             
    [device beginGeneratingDeviceOrientationNotifications];
        //Get the notification centre for the app   
    NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];    
    [nc addObserver:self selector:@selector(orientationChanged:)        name:UIDeviceOrientationDidChangeNotification
             object:device];
    

    Implement orientationChanged: method, which will be called when the device change the orientation. you could put code to check the orientation type and called your method.

    - (void)orientationChanged:(NSNotification *)note
    {
        NSLog(@"Orientation  has changed: %d", [[note object] orientation]);
    }
    

    Remove notification in dealloc.

    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
    

    Check the blog post

    Reacting to iPhone’s orientation

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

Sidebar

Related Questions

Is there any way that I can create a new delegate type based on
I am developing an iPhone application that will send sms the logged in user
Suppose there is a user control in a page called Paging.ascx that is embedded
There's a standard pattern for events in .NET - they use a delegate type
Is there any reason for making delegate when using EJB3? Because the only real
Once it is compiled, is there a difference between: delegate { x = 0;
There is a conversion process that is needed when migrating Visual Studio 2005 web
i try to parse within my iPhone SDK 4 http://de.news.search.yahoo.com/news/rss?p=iphone&ei=UTF-8&fl=0&x=wrt there are some german
I've coded a function that works but that is ugly. I'm pretty sure there's
I'm trying to get the following thing done: public delegate void SomeMethod(params object[] parameters);

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.