使用带Dropbox API的NSFileHandle上传文件时Swift编译错误

时间:2016-11-07 19:43:17

标签: dropbox-api swiftydropbox

我正在尝试使用NSFileHandle上传文件的示例。我得到以下编译错误:

我得到了这两次:

Cannot invoke 'uploadSessionStart' with an argument list of type '(input: NSData?)'

我在uploadFirstChunk()中获取一次错误,在uploadNextChunk()中获取一次错误,在此语句中都是:

var data : NSData? = nil
...
data = fileHandle!.readData(ofLength: chunkSize) as NSData?
...
dbClient.files.uploadSessionStart(input: data)<==

我也在uploadNextChunk()中收到此错误:

Type of expression is ambiguous without more context

这是发生的声明:

let destPath = "/MDG/test/Test1.mp4"
...
dbClient.files.uploadSessionFinish(
                cursor: Files.UploadSessionCursor(sessionId: self.sessionId, offset: UInt64(offset)),
                commit: Files.CommitInfo(path: destPath),<==
                input: data!)

0 个答案:

没有答案