我在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')
我在做什么“错误”?
谢谢!
克里斯
答案 0 :(得分:1)
这应该有效:
AVCaptureDevicePosition position = [_recorder device];
请注意,在源文件中。
/**
Change the current used device
*/
@property (assign, nonatomic) AVCaptureDevicePosition device;