gpt4 book ai didi

iOS 11 Xcode 9 : CoreML linker command failed with exit code 1 (use -v to see invocation)

转载 作者:搜寻专家 更新时间:2023-11-01 07:08:43 27 4
gpt4 key购买 nike

我正在尝试使用 AVFoundation 拍摄照片

这是我的代码:

@objc func didTapCameraView() {
self.cameraView.isUserInteractionEnabled = false
let settings = AVCapturePhotoSettings()
let previewPixelType = settings.availablePreviewPhotoPixelFormatTypes.first!
let previewFormat = [kCVPixelBufferPixelFormatTypeKey as String: previewPixelType,
kCVPixelBufferWidthKey as String: 160,
kCVPixelBufferHeightKey as String: 160]
settings.previewPhotoFormat = previewFormat
if flashControlState == .off {
settings.flashMode = .off
} else {
settings.flashMode = .on
}
cameraOutput.capturePhoto(with: settings, delegate: self)
}

但我每次都遇到同样的错误。

enter image description here

如果我在方法中注释代码,那么它构建良好。让我知道我错过了什么。

更新:使用 iPhone 6 iOS11

构建架构

enter image description here

使用物理设备时的快照

enter image description here

最佳答案

我在Apple开发论坛上找到了解释,检查这个link

这个BUG会在后期修复(遗憾的是它在ode 9 GM版本中依然存在)。引用自 Apple 论坛,我们可以使用此解决方法:

As a workaround you can use the SwiftPrivate versions of these API by prepending each API with double underscore (__). For example, change AVCaptureDevice.Format.supportedColorSpaces to AVCaptureDevice.Format.__supportedColorSpaces.

我对其进行了测试并且它有效,他们说这种解决方法被认为是合法的并且不被视为 SPI 使用。

关于iOS 11 Xcode 9 : CoreML linker command failed with exit code 1 (use -v to see invocation),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46335985/

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