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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:41:11+00:00 2026-06-11T19:41:11+00:00

Am facing this problem ever since i upgraded to XCODE 4.5. I have various

  • 0

Am facing this problem ever since i upgraded to XCODE 4.5.

I have various UI elements

UIButton *button1;
UIButton *button2;
UIButton *button3;

- (void)viewDidLoad
 {
    button1 =[[UIButton alloc]init ];
    button1.backgroundColor=[UIColor yellowColor];
[self.view addSubview:button1];


button2 =[[UIButton alloc]init ];
button2.backgroundColor=[UIColor yellowColor];
[self.view  addSubview:button2];


button3 =[[UIButton alloc]init ];
button3.backgroundColor=[UIColor yellowColor];
[self.view  addSubview:button3];
}

whose frames are declared in

 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
 {  
 if(interfaceOrientation==UIInterfaceOrientationPortrait ||[interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown )
 {


 button1.frame=CGRectMake(10,10,10,10);
 button2.frame=CGRectMake(10,30,10,10);

 button3.frame=CGRectMake(10,50,10,10);
 }
      if(interfaceOrientation ==UIInterfaceOrientationLandscapeLeft ||interfaceOrientation==UIInterfaceOrientationLandscapeRight)
{
 button1.frame=CGRectMake(20,10,10,10);
 button2.frame=CGRectMake(20,30,10,10);

 button3.frame=CGRectMake(20,50,10,10);
  }

 return YES;

}

but the frames are not set in Xcode 4.5..
in the previous versions it worked fine.

i need auto sizing badly in my app. so help me.

  • 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-11T19:41:12+00:00Added an answer on June 11, 2026 at 7:41 pm

    You should need to implement new methods(introduced in ‘ios 6’ ) in viewController for orientation

    - (BOOL)shouldAutorotate
    {
    
        return TRUE;
    

    }

    - (NSUInteger)supportedInterfaceOrientations
    {
         return UIInterfaceOrientationMaskAll;
    
    
    }
    

    And Modify You Code place your code inside the in Below Method

    - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)  interfaceOrientation duration:(NSTimeInterval)duration
    {
    
     }  
    

    Also check your window, you need to add the controller on window as rootviewController rather than addSubview like below

    self.window.rootViewController=viewController;

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

Sidebar

Related Questions

This is a design problem I am facing. Let's say I have a cars
I am facing a strange problem and have no idea how to fix this
Hi i'm facing this problem. I have an application with 2 activities: -Activity A
I have been facing a problem since 40days . i didn't get a solution
I´m facing this problem: I have a Button that works like a WrapPanel using
I am facing this problem. I have a stored procedure which returns 6 rows
I have been facing this problem all day long. I have 2 tables Service
I am facing this problem and finding solution for this issue since last 2
I'm facing this problem again and again, but can't find any solution (except mine,
I'm currently facing this problem with ruby on rails 3, devise and facebook oauth.

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.