Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个程序,该程序需要能够检测 iPad 中是否存在相机硬件。我认为最简单的方法是确定设备是哪一代,但如果有更简单的方法来检测也可以工作的硬件。该应用程序所设计的 iPad 可能是最近购买的,并且在标准更新版本的 iOS 上运行。
不,您可以简单地检查正在使用的设备!
检查所有 iOS 设备:
NSString *deviceType = [UIDevice currentDevice].model; NSLog(deviceType);
为了检查相机
if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) //there is a camera