0
votes

This is the code I use to retrieve picture in my code. I call this function immediately after I send the graphRequest.

let upLoadData = try Data(contentsOf: URL(fileURLWithPath: "https:/graph.facebook.com/(fbUID)/picture?type=large")) let upLoadImage = UIImage(data: upLoadData)?.jpeg(.low)

However, this is the error I get

Error Domain=NSCocoaErrorDomain Code=260 "The file “picture?type=large” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/https:/graph.facebook.com/(my facebook user id)/picture?type=large, NSUnderlyingError=0x604001451df0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

I checked to see if I can access this url and when I type in the url I successfully download the image. Is there any step that I am missing?

1
Maybe add a second / after https:/, just to make this, like, you know, an actual URL …?CBroe

1 Answers

0
votes

The result was due to the fact that I used URL(fileURLWithPath: , not URL(string: