Hi, I want to programmatically differentiate between iPhone4 and iTouch4. Here is what I have tried :
+(BOOL) isIphone4 {
if ( ![ImagePicker isIpodTouch4] ) {
return NO;
}
if ([UIImagePickerController respondsToSelector:@selector(isFlashAvailableForCameraDevice:)]) {
if ([UIImagePickerController isFlashAvailableForCameraDevice:UIImagePickerControllerCameraDeviceRear]) {
return YES;
}
}
return NO;
}
+(BOOL) isIpodTouch4 {
if ([UIImagePickerController respondsToSelector:@selector(isCameraDeviceAvailable:)] ) {
if ([UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceFront]) {
return YES;
}
}
return NO;
}
However, seems like iPod Touch 4 is also passing the test for iPhone4. Does anyone have any ideas?
Thanks.