I get some strange problems when trying to get the screen size in my universal iPhone/iPad app.
I was first using
[[UIScreen mainScreen] bounds]
But it does not return the correct size for iPhone 4 (at least not in the simulator), it just returns 320x480 for all iPhones
Then I changed to
CGSize screenSize = mainscr.currentMode.size;
And it works in the simulator for all apple devices, but when running this line on an iPhone 3GS device the program exits with a SIGABRT
Device is running 3.1.2
Any idea how to get the pixel dimension of the display in a device safe way?