Why [[UIScale mainScreen]] on iPad 3 with Xcode 4.2?

When testing on my iPad 3,

[[UIScreen mainScreen] scale] == 1.0

I understand that this should be 2.0.

I am using the iOS 5.1 SDK with Xcode 4.2 on Snow Leopard, which, as I understand it, is not an “officially supported” configuration. However, I can’t imagine why this would affect what happens exclusively on the device. (I can imagine all sorts of ways to break the simulator.)

+5
source share
2 answers

Prior to Xcode version 4.3 [UIScreen scale] will return 1.0 for iPad 3. Updating to 4.3 will return 2.0 to the correct value.

+4
source

This is because the screen does not scale. You can get the ratio as follows:

[[CCDirector sharedDirector] winSize].width/[[CCDirector sharedDirector] winSizeInPixels].width

1, . , 2, . , .

,

-3

All Articles