IOS 9 Alamofire never uploads an image

I use AlamofireImage to load images in ImageView into a tableview cell (in a separate xib file) The problem is that the image never appears. I think the code is correct and the url is valid too.

Here is the code (very simple):

let placeholderImage = UIImage(named: "imgNoPhoto1")    
if let urlImage = NSURL(string: urlString) {
      photoImage.af_setImageWithURL(urlImage, placeholderImage: placeholderImage)
    }

Any ideas? Maybe the cell does not restart? I tested it on iOS 8 and 9.

I hope you help me! thank you

+4
source share
1 answer

, prepareForReuse , , AlamofireImage # 55. . , , , , .

, , , cURL.


# 1

, , . , - AlamofireImage , . , :

curl -H "User-Agent: iOS" -s -D - http://files.encuentra24.com/normalsq/sv/58/08/68/sv/58/08/68/5808689_5e7d99.jpg -o /dev/null

, URL-. , . , User-Agent, 403. curl:

cnoon:~$ curl -H "User-Agent: iOS Example/com.alamofire.iOS-Example (1; OS Version 9.1 (Build 13B137))" -s -D - http://files.encuentra24.com/normalsq/sv/58/08/68/sv/58/08/68/5808689_5e7d99.jpg -o /dev/null
HTTP/1.1 200 OK
Cache-Control: max-age=2592000, public
Content-Type: image/jpg
Date: Fri, 11 Dec 2015 16:16:38 GMT
Expires: Sun, 10 Jan 2016 16:16:38 GMT
Pragma: no-cache
Server: nginx/1.7.12
Set-Cookie: sessioninfo=uv491lgtjqvkmt267l1nmlbm24; path=/
Set-Cookie: esid=deleted; expires=Thu, 11-Dec-2014 16:16:37 GMT; path=/
Vary: Accept-Encoding
Content-Length: 23757

Content-Type: image/jpg. Content-Type. image/jpeg. AlamofireImage .

, AlamofireImage. Request. :

Alamofire.Request.addAcceptableImageContentTypes(["image/jpg"])

image/jpg . image/jpg. , , AlamofireImage # 58.

+4

Source: https://habr.com/ru/post/1619368/


All Articles