2016-09-20 89 views
4

我得到Alamofire.downloand如下错误:Alamofire - Alamofire.AFError.responseSerializationFailed - Xcode的8

Alamofire.download(URLString).responseData { response in 

      if let data = response.result.value { 
       let image = UIImage(data: data) 
      }else{ 
       print(response.result.error) 
      } 
     } 

Alamofire.AFError.responseSerializationFailed(Alamofire.AFError.ResponseSerializationFailureReason.inputFileReadFailed(文件:/ //private/var/mobile/Containers/Data/Application/40167F58-FF4A-4D19-B01A-F8ED90F794DD/tmp/CFNetworkDownload_1dnNQR.tmp)))

谁能帮助解决其面临的还是同样的问题?

感谢

+0

'URLString'的价值是什么,所以我们可以测试该图片? – ozgur

+0

测试网址:qqxxzx.com/images/cute-wallpaper/cute-wallpaper-10.jpg – user831098

+1

可能重复[Alamofire下载问题](http://stackoverflow.com/questions/39490390/alamofire-download-issue) – Moritz

回答

5

更改Alamofire.download到Alamofire.request,它会下载。你的问题的确切答案,check here