- Home /
Question by
sona.viswam · Aug 14, 2013 at 04:56 AM ·
arraysjsonkey
Using minijson how can i print all values
I am using mini json
I dont know any key values
So how can i print all values and keys in array
i tried these
string response = www.text;
Debug.Log(response);
IDictionary search = (IDictionary) Json.Deserialize(response);
IList tweets = (IList) search["existing"];
foreach (IDictionary tweet in tweets) {
Debug.Log("Tweet details:");
foreach( KeyValuePair<string, string> tweetData in tweet ) {
Debug.Log("Key = " + tweetData.Key.ToString() +
" Value = " + tweetData.Value.ToString());
}
}
But gets error InvalidCastException: Cannot cast from source type to destination type.
For line
foreach( KeyValuePair<string, string> tweetData in tweet ) {
Please help to solve this issue
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613112154im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Error retrieving large data from server and parse it using a Thread 1 Answer
Problem with Arrays 2 Answers
Error ambiguous reference with Json 1 Answer
Animation sets via array lookup 1 Answer
UnityScript for unique simpleJSON lists 0 Answers