在范围内找不到类型“AWSS3TransferManagerUploadRequest”

问题描述

我是 swift 新手。自从我更新 podfile 以来,我在 AWSS3 中遇到了问题

Cannot find type 'awss3transfermanagerUploadRequest' in scope
Cannot find type 'awss3transfermanagerDownloadRequest' in scope

ViewController 中也有 import AWSS3

我不明白这个问题有人也遇到过同样的问题吗

我也检查了这个https://stackoverflow.com/questions/32659346/awss3transfermanageruploadrequest-in-xcode-7

但没有帮助

    var uploadRequests = Array<awss3transfermanagerUploadRequest?>()
    var uploadFileURLs = Array<URL?>()    
    var downloadRequests = Array<awss3transfermanagerDownloadRequest?>()
    
        func download(_ downloadRequest: awss3transfermanagerDownloadRequest) {
            switch (downloadRequest.state) {
            case .notStarted,.paused:
                let transferManager = awss3transfermanager.default()
                transferManager.download(downloadRequest).continueWith(block: { (task) -> AWSTask<AnyObject>? in
                    if let error = task.error {
                        if error.domain == awss3transfermanagerErrorDomain as String
                            && awss3transfermanagerErrorType(rawValue: error.code) == awss3transfermanagerErrorType.paused {
                            print("Download paused.")
                        } else {
                            print("download Failed: [\(error)]")
                        }
                    } else if let exception = task.error {
                        print("download Failed: [\(exception)]")
                    } else {
                        dispatchQueue.main.async(execute: { () -> Void in
                            print("downloaded file url: \(downloadRequest.downloadingFileURL)")
    //                        if let index = self.indexOfDownloadRequest(self.downloadRequests,downloadRequest: downloadRequest) {
    //                            self.downloadRequests[index] = nil
    //                            self.downloadFileURLs[index] = downloadRequest.downloadingFileURL
    //                            
    //                            let indexPath = NSIndexPath(forRow: index,inSection: 0)
    //                            self.collectionView.reloadItemsAtIndexPaths([indexPath])
    //                        }
                        })
                    }
                    return nil
                })
                
                break
            default:
                break
            }
        }
        func downloadAll() {
            for (_,value) in self.downloadRequests.enumerated() {
                if let downloadRequest = value {
                    if downloadRequest.state == .notStarted
                        || downloadRequest.state == .paused {
                        self.download(downloadRequest)
                    }
                }
            }
            
    //        self.collectionView.reloadData()
        }

func listObjects() {
        let s3 = AWSS3.default()
        
        let listObjectsRequest = AWSS3ListObjectsRequest()
        listObjectsRequest?.bucket = "dice-ios"
        s3.listObjects(listObjectsRequest!).continueWith { (task) -> AnyObject? in
            if let error = task.error {
                print("listObjects Failed: [\(error)]")
            }
            if let exception = task.error {
                print("listObjects Failed: [\(exception)]")
            }
            if let listObjectsOutput = task.result {
                if let contents = listObjectsOutput.contents {
                    for s3Object in contents {
                        
                        let downloadingFileURL = URL(fileURLWithPath: NstemporaryDirectory()).appendingPathComponent("download").appendingPathComponent(s3Object.key!)
                        let downloadingFilePath = downloadingFileURL.path
                        
                        if FileManager.default.fileExists(atPath: downloadingFilePath) {
                            self.downloadRequests.append(nil)
                            self.downloadFileURLs.append(downloadingFileURL)
                        } else {
                            let downloadRequest = awss3transfermanagerDownloadRequest()
                            downloadRequest?.bucket = "dice-ios"
                            downloadRequest?.key = s3Object.key
                            downloadRequest?.downloadingFileURL = downloadingFileURL
                            
                            self.downloadRequests.append(downloadRequest)
                            self.downloadFileURLs.append(nil)
                        }
                    }
                    
                    dispatchQueue.main.async(execute: { () -> Void in
//                        self.collectionView.reloadData()
                    })
                }
            }
            return nil
        }
    }

我的代码是这样的,因为我更新了 podfile,我遇到了问题。我在更新 AWS3 时遇到了问题。我需要知道要替换什么。

请帮忙!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...