Note that there are some explanatory texts on larger screens.

plurals
  1. POAFImageRequestOperation producing error
    primarykey
    data
    text
    <p>My app has to download profile pictures from facebook. The code that I wrote to download images works well with image url that has direct links (e.g.: <a href="http://www.mydomain.com/profile_picture.png" rel="nofollow">http://www.mydomain.com/profile_picture.png</a>)</p> <p>But it produces an error for facebook urls (e.g.: <a href="http://graph.facebook.com/100000741043402/picture" rel="nofollow">http://graph.facebook.com/100000741043402/picture</a>)</p> <p>Following is the code:</p> <pre><code>NSURLRequest *imageRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:imageUrl] cachePolicy:NSURLRequestReturnCacheDataDontLoad timeoutInterval:30.0]; AFImageRequestOperation *operation = [AFImageRequestOperation imageRequestOperationWithRequest:imageRequest imageProcessingBlock:nil cacheName:@"nscache" success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image){ profilePicture.image = image; [profilePicture.layer setBorderColor: [[UIColor colorWithRed:137.0/255.0 green:137.0/255.0 blue:137.0/255.0 alpha:1.0] CGColor]]; [profilePicture.layer setBorderWidth: 2.0]; } failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error){ NSLog(@"%@",[error description]); } ]; [operation start]; </code></pre> <p>And following is the response:</p> <pre><code>Error Domain=NSURLErrorDomain Code=-1008 "resource unavailable" UserInfo=0x97e0ae0 {NSErrorFailingURLStringKey=http://graph.facebook.com/100000741043402/picture, NSErrorFailingURLKey=http://graph.facebook.com/100000741043402/picture, NSLocalizedDescription=resource unavailable, NSUnderlyingError=0xa3559b0 "resource unavailable"} </code></pre> <p>Any tips/suggestions would be highly appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload