Possible Duplicate:
Determine device (iPhone, iPod Touch) with iOS
I am using UIDevice (Hardware) by Erica Sadun to detect the device info.
How to detect if it's an iphone4s device?
Possible Duplicate:
Determine device (iPhone, iPod Touch) with iOS
I am using UIDevice (Hardware) by Erica Sadun to detect the device info.
How to detect if it's an iphone4s device?
To detect a specific model, you would need to test for some capability that only that model has, so to detect an iPhone 3GS, check for a video capability on the camera:
#define SOURCETYPE UIImagePickerControllerSourceTypeCamera
// does the device have a camera?
if ([UIImagePickerController isSourceTypeAvailable:SOURCETYPE]) {
// if so, does that camera support video?
NSArray *mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:SOURCETYPE];
bool isA3GS = [mediaTypes containsObject:kUTTypeMovie];
}