如何检测iphone4s
可能重复:
用iPhone SDK确定设备(iPhone,iPod Touch)
我正在使用Erica Sadun的UIDevice(硬件)来检测设备信息。
由于iphone4s是一种新设备,是否有人有办法检测它是否是iphone4s设备。
提前致谢!
要检测特定的型号,您需要测试某些型号的功能,因此要检测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];
}
参考:我如何检测我是否有iPhone 2G,3G,3GS
链接地址: http://www.djcxy.com/p/50363.html下一篇: How can I detect if an iPhone OS device has a proximity sensor?