我最近更新到Xcode 9,当我构建我的应用程序时,我得到Apple Mach-0链接器(iD)错误。在更新项目之前工作得很好。错误如下所示:
Undefined symbols for architecture arm64:
"__T0So22AVCapturePhotoSettingsC12AVFoundation01_abC16SwiftNativeTypesACWP", referenced from:
__T09Lifelapse20CameraViewControllerC14capturePictureyyF in CameraViewController.o
"__T012AVFoundation39_AVCapturePhotoSettingsSwiftNativeTypesPAAE016availablePreviewc11PixelFormatG0SaySo8NSNumberCGfg", referenced from:
__T09Lifelapse20CameraViewControllerC14capturePictureyyF in CameraViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我不确定如何修复此错误,谢谢。
答案 0 :(得分:0)
有一个错误的Xcode 9错误苹果。他们做了一些扩展是私有的。您必须将__
放在这些方法调用上。
示例:强>
尝试更改let previewPixelType = settings.availablePreviewPhotoPixelFormatTypes.first!
到
let previewPixelType = settings.__availablePreviewPhotoPixelFormatTypes.first!
*** Apple意外地将一些AVFoundation API外部协议私有化,因此在访问它们的方法之前有2个不受欢迎的_。