AWS S3 和 Bolts 数据类型问题 (Swift 2.0)

AWS S3 and Bolts data type issue (Swift 2.0)

我找到的所有关于将图像上传到 AWS S3 Buckets 的教程都涉及使用 Bolts 框架。但是,现在我个人正在尝试按照这些教程进行操作,但我遇到了编译时错误:Cannot convert value of type 'BFExecutor to expected argument type 'AWSExecutor!'

在这段代码中:

transferManager.upload(uploadRequest).continueWithExecutor(BFExecutor.mainThreadExecutor(), withBlock:{ [unowned self]
        task -> AnyObject in

        // once the uploadmanager finishes check if there were any errors
        if(task.error != nil){
            NSLog("%@", task.error);
        }else{ // if there aren't any then the image is uploaded!
            // this is the url of the image we just uploaded
            NSLog("https://s3.amazonaws.com/s3-demo-swift/foldername/image.png");
        }

        self.removeLoadingView()
        return "all done";
    })

continueWithExecutor 方法的预期参数是 AWSExecutor!和 AWSContinuationBlock!。

我的播客文件目前有:

platform :ios, '8.0'
use_frameworks!


pod 'Alamofire'
pod 'SwiftyJSON'
pod 'AWSS3'
pod 'AWSCore'
pod 'AWSCognito'
pod 'AWSSNS'
pod 'Parse'
pod 'Bolts'

亚马逊最近是否更改了他们的 SDK 并创建了自己的数据类型?我错过了图书馆吗?在传输过程的这一步中,我找不到任何不使用 Bolts 的来源。

您可以尝试将代码更改为:

 transferManager.upload(uploadRequest).continueWithExecutor(AWSExecutor.mainThreadExecutor(), withBlock:{ [unowned self]
    task -> AnyObject in

现在 AWS 有 Bolt 的子类,所以不需要使用 Bolt。