How to detect iphone4s
Possible Duplicate:
Determine device (iPhone, iPod Touch) with iPhone SDK
I am using UIDevice (Hardware) by Erica Sadun to detect the device info.
Since iphone4s is a new device, does anyone have a way to detect if it's a iphone4s device.
Thanks in advance!
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];
}
reference: how do I detect whether I have iPhone 2G,3G,3GS
链接地址: http://www.djcxy.com/p/50364.html上一篇: 是否有可能获得特定的iPhone型号?
下一篇: 如何检测iphone4s