我一直在努力了解AppleArchive Framework的用途,根据苹果公司的文档示例,我尝试了压缩示例,但我遇到了找不到"ArchiveByteStream"one_answers"FilePermissions"的错误。任何帮助和提示都会很好,谢谢。
https://developer.apple.com/documentation/accelerate/compressing_single_files?language=objc
guard let readFileStream=ArchiveByteStream.fileStream(路径:文件,模式:.readOnly,选项:[],permissions:FilePermissions(rawValue:0o644((其他{回来}
在瞄准模拟器时似乎是苹果的问题。
您可以使用if targetEnviornment
子句包装此代码:
#if !targetEnvironment(simulator)
guard let readFileStream = ArchiveByteStream.fileStream( path: file, mode: .readOnly, options: [ ], permissions: FilePermissions(rawValue: 0o644)) else { return }
#else
fatalError("Apple Archive isn't supported on simulator https://developer.apple.com/forums/thread/665465")
#endif