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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:45:36+00:00 2026-06-13T04:45:36+00:00

I am using XCode 4.5.1 and iOS Simulator (Retina 4 inch) I have project

  • 0

I am using XCode 4.5.1 and iOS Simulator (Retina 4 inch)

I have project that I made one yera ago. So now I want to migrate my project to new resolution.

My problem is next:

I integrate code into my project to detect which resolution I have.

CGRect screenBounds = [[UIScreen mainScreen] bounds];

But after I out value of screenBounds to NSLog I got width = 320 and height = 480, but I exprected to see 1136 × 640.

Have you got the same issues?

  • 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-13T04:45:37+00:00Added an answer on June 13, 2026 at 4:45 am

    Are you sure you are using the 4inch simulator? [[UIScreen mainScreen] bounds] will return the screen bounds in points, not pixels. So in the 4inch iPhone the CGRectreturned should be 320×568.

    So if you call [[UIScreen mainScreen] bounds]:

    • <= iPhone 3GS: 320×480
    • iPhone 4 & iPhone 4S: 320×480
    • iPhone 5: 320×568

    NOTE: If you didn’t add the Default-568h@2x.png file, and the app runs letterboxed the method you used will return the iPhone 4 & 4S values.

    TIP: To determine whether you are using an iPhone 5 or the rest, this code may come handy:

    #define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )
    
    if( IS_IPHONE_5 )
    {
        // iPhone 5
    }
    else
    {
       // Other
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ios xcode project, that compile and running fine for simulator but
I am using Xcode 4.1, on iOS Simulator 4.3 I have imported the ZXing
I'm using Xcode 4.3.2 & iOS 5.1 simulator, and in my project I am
If I create a new iOS 5 project using one of XCode's templates and
I recently started using Xcode 4.2 and the iOS 5 simulator. When I update
I'm writing an iOS 5 app (in Xcode 4.3, using Storyboards and ARC) that
I m using Xcode 4.2 and i have add AviarySDK 2.4.4 in my project.
Is there a way to configure the iOS Simulator application directory? I'm using Xcode
I have a .png resource in my XCode iOS project . I build and
I have developing an iPhone application using xcode 4 which is compatible with iOS

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.