iOS:AVCaptureDevicePosition,如何从SCRecorder获取(错误:接收器类型不好)

时间:2015-02-01 15:58:16

标签: ios objective-c iphone camera avcapturedevice

我在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')

我在做什么“错误”?

谢谢!

克里斯

1 个答案:

答案 0 :(得分:1)

这应该有效:

AVCaptureDevicePosition position = [_recorder device];

请注意,在源文件中。

/**
 Change the current used device
 */

@property (assign, nonatomic) AVCaptureDevicePosition device;