2014-10-23 2 views
1

을 존재하고 내가 사용자의 성을 얻으려고 KeyNotFoundException: The given key was not present in the dictionary.페이스 북 KeyNotFoundException 키가 그래서 페이스 북 유니티 API를 사용하고

을받을 이유를 알아낼 수는 없지만. 이름이 잘 작동합니다. "last_name"키가 포함되어있는 줄에 Facebook 응답을 인쇄하지만 여전히 예외가 발생합니다.

void APICallback(){ 
    Dictionary<string,string> profile = Util.DeserializeJSONProfile(result.Text); 
    print (result.Text); 
    currentUser["Name"] = profile["first_name"]; 
    currentUser["LastName"] = profile["last_name"]; 
} 

result.Text : 그것은 내가 result.Text을 구문 분석 SimpleJson을 사용 Util.DerializeJSONProfile에 버그가 가지고 그것은 완벽하게 작동

{"id":"XXXXXXX","first_name":"David","last_name":"Richard","friends":{"data":[],"summary":{"total_count":58}}} 
+0

프로필을 인쇄하면 무엇이 포함되어 있습니까? – WizKid

+0

System.Collections.Generic.Dictionary'2 [System.String, System.String] Unity에서 전체 사전을 인쇄하는 방법을 모르겠다. – david2391

+0

반복하여 키를 인쇄하고 – WizKid

답변