AVCaptureDevicePosition

AVCaptureDevicePosition

我在Objective-C中有一些代码,如下所示:

@interface SCRecorderPViewController () {
    SCRecorder *_recorder;
    UIImage *_photo;
    SCRecordSession *_recordSession;
    UIImageView *_ghostImageView;
    CGFloat screenWidth;
    CGFloat screenHeight;

}


我想要获得活动的设备/相机(无论是正面的还是背面的),如下所示:

AVCaptureDevicePosition position = [[_recorder device] position];


但我收到一个错误:Bad receiver type 'AVCaptureDevicePosition' (aka 'enum AVCaptureDevicePosition')

我究竟做错了什么”?

谢谢!

克里斯

最佳答案

这应该工作:

AVCaptureDevicePosition position = [_recorder device];


请注意,在源文件中。

/**
 Change the current used device
 */

@property (assign, nonatomic) AVCaptureDevicePosition device;

10-06 04:41