I need to detect if the user is using an iPhone 4, but I need this to work on the simulator (cause Apple forgot my country and there’s no sign of iPhone 4 here soon).
I found this
http://www.clintharris.net/2009/iphone-model-via-sysctlbyname/
but running this on the simulator it does not detect the correct version. I mean, Xcode 3.2.3 has two simulators (3G/3GS and 4). I was expecting the detection method to tell me the correct version I am using… but instead it tells me “iphone simulator”…
Is there any way to do that?
thanks.
You don’t need to detect the system version in your case.
Suppose an image is named
foo.png, then you just need to addfoo~ipad.pngfor iPadfoo@2x~iphone.pngfor iPhone 4and load the image with
[UIImage imageNamed:@"foo.png"]. See the iPhone Application Programming Guide for detail.