簡體   English   中英

在范圍內找不到“ArchiveByteStream”

[英]Cannot find 'ArchiveByteStream' in scope

我一直在嘗試了解 AppleArchive Framework 的用途,根據 Apple 記錄的示例,我嘗試了一個 Compression 示例,但我收到了找不到“ArchiveByteStream”和“FilePermissions”的錯誤。 任何幫助和提示都會很好,謝謝。

https://developer.apple.com/documentation/accelerate/compressing_single_files?language=objc

守衛讓 readFileStream = ArchiveByteStream.fileStream(路徑:文件,模式:.readOnly,選項:[],權限:FilePermissions(rawValue:0o644))否則{返回}

以 Simulator 為目標時似乎是Apple 的問題

您可以使用 and 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM