0
votes

In XCode, I have set my IOS simulator as iPhone (Retina 3.5-inch). However in my code, when I display the screen dimensions (using Bounds CGRect), I get 320 x 480 instead of expected 640 x 960. Any idea why ? I am using the latest XCode and output is named iPhone 6.1 Simulator. Thanks.

2

2 Answers

1
votes

Try this:

  UIScreen *mainScreen = [UIScreen mainScreen];
  UIScreenMode *screenMode = [mainScreen currentMode];
  CGSize realSize = [screenMode size];
1
votes

Frame and bounds are measured in points not pixels. On retina devices, 4 pixels will be in 1 point while non-retina devices have 1 pixel for every point.