【问题标题】:Error retrieving profile picture from facebook swift FBSDK从 facebook swift FBSDK 检索个人资料图片时出错
【发布时间】:2018-12-20 04:48:41
【问题描述】:

这是我用来在我的代码中检索图片的代码。 我在发送 graphRequest 后立即调用此函数。

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

但是,这是我得到的错误

Error Domain=NSCocoaErrorDomain Code=260 "无法打开文件“picture?type=large”,因为没有这样的文件。" 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"}}

我检查了我是否可以访问此网址,当我输入网址时,我成功下载了图像。 有没有我遗漏的步骤?

【问题讨论】:

  • 也许在https:/ 之后添加第二个/,只是为了让这个,就像,你知道的,一个实际的网址......?

标签: swift facebook profile fbsdk fbsdkloginkit


【解决方案1】:

结果是因为我使用了 URL(fileURLWithPath: ,而不是 URL(string:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-09-05
    • 1970-01-01
    • 2017-09-30
    • 2014-01-09
    • 2017-11-16
    • 2015-05-21
    • 1970-01-01
    • 2012-12-10
    相关资源
    最近更新 更多