【问题标题】:Incompatible pointer types sending 'AVCapturePhotoSettings *' to parameter of type 'NSArray<AVCapturePhotoSettings *> * _Nonnull'不兼容的指针类型将“AVCapturePhotoSettings *”发送到“NSArray<AVCapturePhotoSettings *> * _Nonnull”类型的参数
【发布时间】:2020-03-11 22:58:04
【问题描述】:

我收到以下代码的上述错误

captureOutput = [[AVCapturePhotoOutput alloc]init];
AVCapturePhotoSettings* hots = [AVCapturePhotoSettings photoSettingsWithFormat:@{AVVideoCodecKey:AVVideoCodecTypeJPEG}];

[captureOutput setPreparedPhotoSettingsArray:hots completionHandler:nil];

我正在尝试制作条形码扫描仪

【问题讨论】:

    标签: ios objective-c camera


    【解决方案1】:

    改用这个: [captureOutput setPreparedPhotoSettingsArray:@[hots] completionHandler:nil];

    【讨论】:

    • 像魅力一样工作!现在有点错误[AVCapturePhotoOutput capturePhotoWithSettings:delegate:] Nil settings'这是导致它的代码[captureOutput capturePhotoWithSettings:settings delegate:self];
    • 没关系通过AVCapturePhotoSettings* settings = [[AVCapturePhotoSettings alloc] init];解决它
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多