I'm writing an app that needs to function differently if it is running on different models of the iPhone/iPod Touch. How can I check if the app is running on 3GS, 3G or other?
+2
A:
The UIDevice
class provides some information like this.
But you're probably much better off testing for capabilities ("does this device support compass headings?") than for specific models ("is this device a 3GS?"). What is it that you're trying to do?
Edit: for the specific example I presented above, see the headingAvailable
property of CLLocationManager
. It will be YES
if and only if heading information can be obtained from the device.
Sixten Otto
2009-10-14 20:42:20
You hit on what I'm trying to do actually. I want to support the compass when it is available and when it isn't, do something else entirely.
derekvanvliet
2009-10-14 20:45:38