Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to differentiate between iphone4 and iphone 3

Tags:

ios

ccsprite

I am trying to build a game for the iphone using cocos2d engine. I wanted to know how can I tell a difference whether the user is using iphone 4 or iphone 3 as I wanted to load hi-resolution graphics for the iphone4 and low-resolution for iphone 3. I know if I use @2x.png at the end of the image file name UIImage loads the hi-resolution image by itself if I am using an iphone 4 but for the game I am using cocos2d engine's CCSprite class to load the graphics.

I would really appreciate the reply.

Regards, Ankur

like image 844
Ankur Avatar asked Jul 20 '10 20:07

Ankur


People also ask

How can you tell if it is an iPhone 4 or 4s?

Know the model number. The iPhone 4 has the following model numbers: A1332 for GSM models and A1349 for CDMA models. The iPhone 4s has these model numbers: A1431 for GSM model China, and A1387 for CDMA models and GSM models. You can see these model numbers at the back of the iPhone.

Is an iPhone 4 4G or 3G?

The iPhone 4 Is Not a 4G Phone Just like previous iPhone models, the iPhone 4 is not compatible with 4G networks. Because the iPhone 4 only used the 3G and EDGE cellular networks, the iPhone 4 is not a 4G phone.


1 Answers

You could check the scale of the screen.

if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] && [[UIScreen mainScreen] scale] == 2){     //iPhone 4 } 
like image 146
Tom Irving Avatar answered Oct 13 '22 21:10

Tom Irving