XCode 7 中的 AWSS3TransferManagerUploadRequest [英] AWSS3TransferManagerUploadRequest in XCode 7

查看:17
本文介绍了XCode 7 中的 AWSS3TransferManagerUploadRequest的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天升级到 Xcode 7/Swift 2.0.我的项目正在使用 CocoaPods,我正在 POD 文件中导入所有与 AWS 相关的文件,我已经设置了我的桥接头,并导入了亚马逊告诉我的所有文件.在升级到 Swift 2.0 之前,与 AWS 相关的一切工作正常(即将图像上传到 S3 存储桶)

I upgraded to Xcode 7/Swift 2.0 today. My project is using CocoaPods and I am importing all AWS related files in the POD-file, I have set up my bridging-header and I import all the files Amazon tells me to. Before upgrading to Swift 2.0, everything AWS related was working fine (namely uploading images into an S3 bucket)

现在升级后,我无法再在我的项目中创建 AWSS3TransferManagerUploadRequest 的实例.行:

Now after upgrading, I can not create an instance of AWSS3TransferManagerUploadRequest in my project anymore. The line:

let uploadRequest = AWSS3TransferManagerUploadRequest()

产生和错误.

(Use of unresolved identifier 'AWSS3TransferManagerUploadRequest')

任何想法为什么会发生这种情况?AWSCognitoCredentialsProvider/AWSServiceConfiguration 代码在我的 AppDelegate.Swift 中运行良好

Any ideas why this is happening? The AWSCognitoCredentialsProvider/AWSServiceConfiguration code is working fine in my AppDelegate.Swift

推荐答案

找到解决方案 - 由于我使用的是use_frameworks!",CocoaPods 将所有 Pod 从静态库转换为框架.

Found a solution - Since I'm using "use_frameworks!", CocoaPods converts all pods from static libraries to framerworks.

通常,当您将 Objective-C 代码导入 Swift 时,您会通过在项目的桥接头"中包含包含该代码的文件的标题来实现.这确实是您从静态库(您的 pod 曾经是)

"Normally when you’re importing Objective-C code into Swift, you do so by including the header of the file containing that code in the "Bridging Header" for your project. And that is indeed how you include code from a static library (which your pods used to be.)

但这不是您从框架中导入 Objective-C 代码的方式."

But it is not how your import Objective-C code from a Framework."

所以我简单地添加了

import AWSS3

到我的控制器,一切又正常了.

to my controller, and everything worked fine again.

在此处找到解决方案:http://rogueleaderr.com/post/115372471213/unresolved-identifier-in-swift-when-importing

这篇关于XCode 7 中的 AWSS3TransferManagerUploadRequest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆