Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
示例AVCAM-Swift Xcode v9_Swift - Fatal编程技术网

示例AVCAM-Swift Xcode v9

示例AVCAM-Swift Xcode v9,swift,Swift,当我使用Xcode 9 swift 4运行应用程序时,我遇到了这个错误 架构x86_64的未定义符号: “uu T0So22AVCapturePhotoSettingsC12AVFoundation01_uABC16SwiftNativeTypesACWP”, 引用自: __T014vision_应用程序_dev8CameravCC06didtapd4viewyyyf在CameraVC.o“uuu T012AVFoundation39_AVCapturePhotosettingsSwiftNat

当我使用Xcode 9 swift 4运行应用程序时,我遇到了这个错误

架构x86_64的未定义符号:
“uu T0So22AVCapturePhotoSettingsC12AVFoundation01_uABC16SwiftNativeTypesACWP”, 引用自: __T014vision_应用程序_dev8CameravCC06didtapd4viewyyyf在CameraVC.o“uuu T012AVFoundation39_AVCapturePhotosettingsSwiftNativeTypesPae016可用Previewc11PixelFormatg0Says 6uint32 VGFG”, 引用自: __T014vision_app_dev8; cameravcc06didtapd4viewyyf在CameraVC.o ld:未找到架构x86_64的符号clang:错误:链接器 命令失败,退出代码为1(使用-v查看调用)

试着改变
let previewPixelType=settings.availablePreviewPhotoPixelFormatTypes.first

让previewPixelType=设置。\u可用PreviewPhotoPixelFormatTypes.first

***苹果公司意外地将一些AVFoundation API外部协议设置为私有协议,因此在访问这些协议的方法之前,有两个未登录的
\uu

资料来源:


来源:

获取相同错误的副本
 @objc func didTapCameraView() {
    self.cameraView.isUserInteractionEnabled = false
    self.spinner.isHidden = false
    self.spinner.startAnimating()

    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)
}