Lots of good info about the device you are running on can be found through this object.
Looks like there is no way to know the type of the device your running on. The max to know is whether its an iPhone or an iPod touch which is the value returned from the model property
i'm working on a class to give me exactly what you're looking for. not sure when i'll get around to finishing it but i'm basically taking information from UIDevice and then testing individual hardware functions to determine the device... such as if video or compass capabilities exist then it must be a 3gs, if gps exists it must be at least a 3g or 3gs, if camera exists it must be an iphone, 3g or 3gs etc..
Good luck.. i'll post my class when done.. but in the mean time something like this shouldnt take you long to build.. and in the process you'll learn some things along the way.
John
__________________
---------------------------------------------------------------------- I love being a dad, flying airplanes and writing code.
----------------------------------------------------------------------
Follow me on Twitter: @BostonMerlin
Feed your brain on Twitter: @iPhoneDev101
----------------------------------------------------------------------
iPhone Apps:
i'm working on a class to give me exactly what you're looking for. not sure when i'll get around to finishing it but i'm basically taking information from UIDevice and then testing individual hardware functions to determine the device... such as if video or compass capabilities exist then it must be a 3gs, if gps exists it must be at least a 3g or 3gs, if camera exists it must be an iphone, 3g or 3gs etc..
Good luck.. i'll post my class when done.. but in the mean time something like this shouldnt take you long to build.. and in the process you'll learn some things along the way.
John
sounds like fun. I guess I will do that, needs some digging though to know what's different between each model.
nameString will be either iPod1,1 iPod1,2 and iPhone1,1 iPhone1,2 iPhone1,3
You will also need to import this header:
Code:
#import <sys/utsname.h>
__________________ FingerTest: Fun game where you put your fingers to the ultimate test! [AppStore] - $0.99 Penguins!: Addictive game. [AppStore] - $1.99 MTracker: Easy to use money tracker. [AppStore] - $0.99 iBubblePop: Try to pop as many bubbles as you can![AppStore] - $1.99
If you would like me to work on a project for you, contact me at the following email address. madpike05@aol.com
nameString will be either iPod1,1 iPod1,2 and iPhone1,1 iPhone1,2 iPhone1,3
You will also need to import this header:
Code:
#import <sys/utsname.h>
... if Apple allows this function "uname". I had such a problem before and I needed to change that.
I need to get the Device information (version) too, but is it possible to get information if the device has a retina display?
How does iOS "decide", if it should take a picture called "picture.png" or "picture_name@2x.png"?