2017-08-22 5 views
4
@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) 
} 

私はXcodeの9を使用してアプリ迅速に実行したときに、私はこのエラーを取得していますが4サンプルAVCAM - スウィフトXcodeのV9

Undefined symbols for architecture x86_64:
"__T0So22AVCapturePhotoSettingsC12AVFoundation01_abC16SwiftNativeTypesACWP", referenced from: __T014vision_app_dev8CameraVCC06didTapD4ViewyyF in CameraVC.o "__T012AVFoundation39_AVCapturePhotoSettingsSwiftNativeTypesPAAE016availablePreviewc11PixelFormatG0Says6UInt32VGfg", referenced from: __T014vision_app_dev8CameraVCC06didTapD4ViewyyF in CameraVC.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

+0

同じエラー –

+0

重複のhttps://stackoverflow.com/questions/46202060/apple-mach-o-linker-ld-error-group-を取得with-swift-3-xcode-9-gm –

答えて

1

let previewPixelType = settings.__availablePreviewPhotoPixelFormatTypes.first!

let previewPixelType = settings.availablePreviewPhotoPixelFormatTypes.first!

を変更してみてください

*** Appleが誤って一部のAVFoundationを作成しましたAPIの外部プロトコルはプライベートなので、アクセスするメソッドの前に2つの望ましくないコード_があります。

出典:https://forums.developer.apple.com/thread/86810#259270

出典:Try Sample AVCAM from apple found error

関連する問題