gpt4 book ai didi

swift4 - 类型 'AVCapturePhotoSettings'的值没有成员'availablePreviewPhotoPixelFormatTypes

转载 作者:行者123 更新时间:2023-12-05 00:15:04 25 4
gpt4 key购买 nike

@objc func launchCoreML() {
let settings = AVCapturePhotoSettings()
let previewPixelType = settings.availablePreviewPhotoPixelFormatTypes.first
let previewFormat = [
kCVPixelBufferPixelFormatTypeKey as String: previewPixelType,
kCVPixelBufferWidthKey as String: 160,
kCVPixelBufferHeightKey as String: 160
] as [String : Any]

settings.previewPhotoFormat = previewFormat
cameraOutput.capturePhoto(with: settings, delegate: self)
}

我有一个错误说:

Value of type 'AVCapturePhotoSettings' has no member 'availablePreviewPhotoPixelFormat'.



我正在使用Xcode 9的测试版。

最佳答案

在beta 4中,此名称已重命名为__availablePreviewPhotoPixelFormat。我还没有看过Beta 5。

关于swift4 - 类型 'AVCapturePhotoSettings'的值没有成员'availablePreviewPhotoPixelFormatTypes,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45560892/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com