우편에서 차트 정보를 가져올 때 키 값을 찾을 수 없습니다.

BackendReturnObject BackendPostInfo = Backend.Social.Post.GetPostListV2();
JsonData postInfo = BackendPostInfo.GetReturnValuetoJSON()[“fromAdmin”];

// 가능
postInfo[0][“title”][“S”].ToString();

// 불가능
postInfo[0][“chartName”][“S”].ToString();

타이틀 스트링은 가져올 수 있으나 차트이름을 가져올 때 키 값을 찾을 수 없다고 출력됩니다.
아래는 오류 내용이며, 혹시 제가 잘못 접근하고 있는지 확인좀 부탁드립니다. ( _ _ )

KeyNotFoundException: The given key was not present in the dictionary.

System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at :0)
LitJson.JsonData.get_Item (System.String prop_name) (at <498e8279b39b41478600b851a0c83f73>:0)
PostManager.AddPost () (at :0)
PostManager.OnEnable () (at :0)
UnityEngine.EventSystems.EventSystem:Update()

안녕하세요 개발자님

해당 로직이라면 정상적으로 chartName을 가져올 수 있을 겁니다.

Debug.Log(BackendPostInfo);

위 처럼 리턴값의 전체 json을 확인 및 해당 키값이 존재하는지 확인해주시면 감사하겠습니다.

감사합니다! 덕분에 키 값을 찾았습니다! ^^
chartName이 아니라 chartFileName이었네요!

좋아요 1