1

I am using Xcode 6, and am trying to update my view for ios 8 and iphone 6, the problem is

some of my views are displayed on the screen based on screen height and width calculations

The problem is when i run this command on my app

(lldb) po [UIScreen mainScreen]

I get <UIScreen: 0x7fc533413430; bounds = {{0, 0}, {320, 568}}; mode = <UIScreenMode: 0x7fc533413af0; size = 640.000000 x 1136.000000>>

when in reality i am testing it on iphone 6, and expect the height to be 667

why am I getting the wrong height ?

Lena Bru
  • 13,521
  • 11
  • 61
  • 126
  • 1
    Make sure you set launch images for this device, I had the same problem and it got solved when I added launch images for iPhone 6 and 6 plus – oren Jan 14 '15 at 11:52
  • http://stackoverflow.com/questions/25755443/iphone-6-plus-resolution-confusion-xcode-or-apples-website-for-development see Hannes Sverrisson's answer – chiliNUT Jan 14 '15 at 11:56
  • @oren is absolutely right. Unless you update launch images for each device, the OS will continue to draw against a co-ordinate system based on the dimensions of the older launch images. – n00bProgrammer Jan 14 '15 at 12:06
  • @Utkarsh Singh Can you provide a pointer to the Apple docs that state that, I would like to read them. – zaph Jan 14 '15 at 12:10
  • 1
    @Zaph, I don't remember reading anything about this in the official docs, but this issue first arose with the launch of iPhone 5, when the height changed. This is how we (generally) dealt with it, by updating the Launch Image. [This answer](http://stackoverflow.com/a/25755757/2082856) was helpful (last note in the answer). – n00bProgrammer Jan 14 '15 at 12:20

0 Answers0