Is ther any way to perform a runtime check for the iPhone device at runtime?
It has to be able to differenciate iPhone 4 from other iPhone/iPod touch models.
Any workaround that does the same thing is OK too.
Is ther any way to perform a runtime check for the iPhone device at
Share
I use some code like this for the same purpose:
Only iOS 4.x+ devices support the UIScreen
scaleinstance method. And since iPhone4’s don’t run iOS 3, we can rule those out right away. Next, we check if the scale factor is 2.0, if so we know it has a retina display.While this isn’t definitive (apple could release another retina device tomorrow), it does test ‘model’ where it’s important — i.e., you could be fetching images from a web service that provides @2x images and standard images, which is what I’m doing, which means you need to write the scaling image support manually, you don’t get it for free as with UIImage’s
-imageNamed:for local files.