iOS-无法调用非功能类型“ NSProgress”的值 [英] iOS - Cannot call value of non-function type 'NSProgress'
问题描述
我正在尝试使用Alamofire下载文件,并取得进展。但是我在 progress
行遇到了这个错误。
不能调用非函数类型'NSProgress'的值 c
出什么问题?我看到的所有示例,即
编辑:
在@mvoelkl建议之后继续,我在进度功能中添加了括号。但是结果保持不变:
我希望更新您的 Alamofire容器
时会解决此问题。
此处提到此问题:- https://github.com/SwiftyJSON/Alamofire-SwiftyJSON/issues/40
I'm trying to download a file using Alamofire, with progress. But I get this error at the progress
line.
Cannot call value of non-function type 'NSProgress'
What's the problem? All the examples I've seen, namely the official one, do the exact same thing!
Alamofire.download(.GET, nsurl!.absoluteString, destination: { (temporaryURL, response) in
return filepath
})
.progress { (bytesRead, totalBytesRead, totalBytesExpectedToRead) in // <------ ERROR HERE
dispatch_async(dispatch_get_main_queue(), {
self.progressBar?.progress = totalBytesRead / totalBytesExpectedToRead
})
}
.response { (request, response, _, error) in
self.loadImageFromFile(filepath.absoluteString)
}
EDIT:
After @mvoelkl's suggestion, I added parenthesis to the progress function. But the result stayed the same:
I hope this issue fix when update your Alamofire pod
.
Here mention this issue :- https://github.com/SwiftyJSON/Alamofire-SwiftyJSON/issues/40
这篇关于iOS-无法调用非功能类型“ NSProgress”的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!