小编Syd*_*ter的帖子

导入时无法打开文件“xxx”,因为您无权查看它

我对 Swift 和 SwiftUI 非常陌生,我正在尝试编写一个 iOS 应用程序来读取文件夹,计算每个文件的哈希值,然后将它们复制到外部驱动器。

现在我正在尝试导入一个文件并计算其哈希值。但是,我总是遇到同样的错误,说我没有查看它的权限。

这是我的代码:

    //
//  ContentView.swift
//  FileExporter
//
//  Created by adrien le falher on 27/09/2020.
//

import SwiftUI
import CryptoKit

struct ContentView: View {
    
    @State private var document: MessageDocument = MessageDocument(message: "Hello, World!")
    @State private var isImporting: Bool = false
    @State private var isExporting: Bool = false
    @State private var isMoving: Bool = false
    
    
    var body: some View {
        VStack {
            GroupBox(label: Text("Message:")) {
                TextEditor(text: $document.message)
            }
            GroupBox {
                HStack {
                    Spacer() …
Run Code Online (Sandbox Code Playgroud)

ios file-import swift swiftui xcode12

6
推荐指数
1
解决办法
2928
查看次数

标签 统计

file-import ×1

ios ×1

swift ×1

swiftui ×1

xcode12 ×1