Sum*_*Sum 3 iphone xcode camera
我想知道如何只让iPhone 4使用我的使用前置摄像头的应用程序.我可以做一个 + (BOOL)isCameraDeviceAvailable:(UIImagePickerControllerCameraDevice)
,如何实现它,如果它返回no,它会给出某种错误
或者我必须使用NSString*DeviceType等.
如果iPhone 4 ......什么都不做
if else ...显示提醒?
如何在我的应用程序中实现它?
TIA!
你可以添加front-facing-camera到UIRequiredDeviceCapabilities你的Info.plist.这样,如果没有前置摄像头,应用程序将无法运行,如果没有iPhone 4,您的用户将无法从App Store下载.
把它放在你的app delegate的applicationDidFinishLaunching方法中:
if (![UIImagePickerController isCameraDeviceAvailable: UIImagePickerControllerCameraDeviceFront])
{
[[[[UIAlertView alloc] initWithTitle: @"No Front Camera"
message: @"This app requires a front camera."
delegate: self
cancelButtonTitle: @"Ok"
otherButtonTitles: nil] autorelease] show];
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2460 次 |
| 最近记录: |