开发者

iPhone etc: how to tell if the device has a camera?

Version 3.1.3 if its relevant.

开发者_开发知识库

There is this suggestion which may work now, but in the future?

NSString *device = [UIDevice currentDevice].model;

if([device isEqualToString:@"iPhone"])


#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:(NSString*)kUTTypeMovie];
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜