tags:

views:

127

answers:

2

Hey guys, here's a weird question. I'm doing device detection and I noticed that the iphone 4 reports the same resolution as the iphone 3g(s): 320x480.

shouldn't this be higher? or did I miss something?

+2  A: 

You missed something. This is described in the WWDC "What's New Cocoa Touch" session (Session 101), if I recall correctly. (If you're a registered developer, you can download those on iTunes University.)

They kept the dimension reporting the same to ensure that apps scaled correctly in both iPhone 4 and iPhone 3/3G/3Gs. 1 point is no longer 1 pixel.

Essentially, the higher-resolution aspects that you'll use most will be new graphical assets. There is a naming convention, as well, which allows the phone to automatically determine whether to load a lower-resolution version of the resource (for 320x480 models), or the higher-resolution version (for 640x960 models).

Head over to the Apple Developer Site, sign in, and grab those videos. Great stuff came out of there.

(And boy, I hope I didn't just break NDA.)

John Rudy
well, I've got apple dev, so in my book, you're alright.but thanks. this answers a lot. I have yet to catch up on my wwdc stuff.
Oren Mazor
You will know (about breaking NDA) soon enough, the black helicopters usually take about half an hour to an hour to arrive.
Ukko
@Ukko: Half an hour? Man, you must live in the middle of nowhere. They get here is 5-10 minutes.
Stephen Canon
+2  A: 

Supporting High-Resolution Screens is a good read in this regard:

In iPhone OS there is a distinction between the coordinates you specify in your drawing code and the pixels of the underlying device. When using native drawing technologies such as Quartz, UIKit, and Core Animation, you specify coordinate values using a logical coordinate space, which measures distances in points. This logical coordinate system is decoupled from the device coordinate space used by the system frameworks to manage the pixels on the screen. The system automatically maps points in the logical coordinate space to pixels in the device coordinate space, but this mapping is not always one-to-one. This behavior leads to an important fact that you should always remember:

One point does not necessarily correspond to one pixel on the screen.

Shaji