ipad 2相机支持检测

Mar*_*ark 4 iphone camera objective-c ipad

我有一个使用以下宏的应用程序:

#define IS_IPAD ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] && [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)

这对我很有用.

但是,我用它来关闭在应用程序中拍照的选项.

无论设备如何,如何检测相机选项是否可用?

Jos*_*erg 12

[UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera];

这应该工作