我的图形请求不断出现此错误?
输入“是吗?” 没有下标成员
错误指向结果…。这仅在我转换为Swift 3时发生了…有人吗????
let nextrequest: FBSDKGraphRequest = FBSDKGraphRequest(graphPath: "me/friends", parameters: ["fields": "name, id, gender"], httpMethod: "GET") nextrequest.start { (connection, result, error) -> Void in guard let listOfFriends = result["data"] as? [AnyObject] else { return } } }
试试这个
let nextrequest: FBSDKGraphRequest = FBSDKGraphRequest(graphPath:"me/friends", parameters: ["fields": "name, id, gender"], httpMethod: "GET") nextrequest.start { (connection, result, error) -> Void in guard let result = result as? [String:[AnyObject]], let listOfFriends = result["data"] else { return } } }