S.J. Lim S.J. Lim - 14 days ago 4
Objective-C Question

How do I get the retina display resolution?

I do like this :

CGRect ScreenSize = [[UIScreen mainScreen]bounds];

But result is 480 * 320 in iphone4.

How do I get the resolution of retina display in iphone4?


You don't need to. The OS automatically translates from 320px x 480px to the retina display. This is because the resolution of the screen isn't actually higher, it just has a high pixel density (4px for every 1px in <3Gs)

The idea is so everything looks sharper/better, not so you can fit more on the screen. (otherwise you would have to double everything's size, just to be able to see it)

But if you really need to you can use the following

UIScreen *MainScreen = [UIScreen mainScreen];
UIScreenMode *ScreenMode = [MainScreen currentMode];
CGSize Size = [ScreenMode size]; // <--- Real screen size