我正在使用UIDevice (Hardware) by Erica Sadun来检测设备信息 如何检测它是否是iphone4s设备?
答案 0 :(得分:-2)
要检测特定型号,您需要测试只有该型号具有的功能,以便检测iPhone 3GS,检查相机上的视频功能:
#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];
}