Detecting iPhone/iPod version
In some cases it is required to change application behaviour depending on iPhone or iPod Touch device version.
#import <sys/utsname.h>;
...
struct utsname u;
uname(&u);
After calling uname() function, u.machine will be “iPod1,1″, “iPod2,1″ for iPod Touch and “iPhone1,1″, “iPhone1,2″, “iPhone2,1″ for iPhone (or similar depending on current device).
Source:
