skip to content

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:

You can leave a response, or trackback from your own site.

Leave a Reply