【发布时间】:2015-09-12 14:00:15
【问题描述】:
有人知道我为什么会收到这个错误吗?我有一个字段参数集。我是 swift 和编码的新手,任何帮助将不胜感激。
let graphRequest = FBSDKGraphRequest(graphPath: "me", parameters: ["fields": "id, name, gender"])
// start the request:
graphRequest.startWithCompletionHandler({
// void in means that it will return nothing upon completion
(connection, result, error) -> Void in
// do an error check
if error != nil {
print(error)
} else if let result = result {
PFUser.currentUser()?["gender"] = result["gender"]
PFUser.currentUser()?["name"] = result["name"]
PFUser.currentUser()?.save()
// use the user's FB id to get their public profile. First make their id a string:
let userId = result["id"] as! String
// next go to the internet and get their photo from FB:
let facebookProfilePictureUrl = "https://graph.facebook.com/" + userId + "/picture?type=large"
【问题讨论】: