2017-01-05 15 views
-5

私のアプリにログインしている他のFacebookの友達のリストが必要ですが、以下のコードは機能していません。私はアプリ上に他の友人がいることを知っているが、それが印刷するものはすべて "data(); totalCount(796);"なぜデータは常に空ですか?Facebookの友だちリストはすぐに

let params = ["fields": "id, first_name, last_name, middle_name, name, email, picture"] 
    let request = FBSDKGraphRequest(graphPath: "me/friends", parameters: params) 
    request!.start { (connection, result, error) -> Void in 

     if error != nil { 
      print(error!) 
     } 
     else if result != nil{ 
      print(result!) 
     } 
    } 
+0

http://stackoverflow.com/a/23417628/1427878 – CBroe

答えて

1

コードはあまりありませんが、情報を取得した後にデータ配列をキャストするのを忘れているようです。あなたの他のコードを見ずに話すのは難しいですが、thisの回答が役に立つかもしれません。

ここでは、適切なデータのキャストと取得の例を示します。

func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) { 
    let cell = tableView.cellForRowAtIndexPath(indexPath) as YourCell 
    //cell.value, cell.text, cell.randomValue or whatever you need 
} 
関連する問題