{"id":54342,"date":"2017-08-11T14:57:52","date_gmt":"2017-08-11T12:57:52","guid":{"rendered":"http:\/\/elwinlee.com\/blog\/?p=54342"},"modified":"2017-08-11T16:29:35","modified_gmt":"2017-08-11T14:29:35","slug":"parse-get-data-as-multidimensional-list-unity","status":"publish","type":"post","link":"https:\/\/www.elwinlee.com\/blog\/parse-get-data-as-multidimensional-list-unity\/","title":{"rendered":"[How] Parse.com Get Data as Multidimensional List in Unity3D C#"},"content":{"rendered":"<p>I recently found that you&#8217;re able to save multidimensional data to Parse. Saving the data wasn&#8217;t a problem though, but getting it back from a ParseObject took me a while before I finally got it working.<!--more--> You have to cast it as an IList first with Get&lt;IList&lt;object&gt;&gt;, and then cycle through each IList item and casting those as an another IList. Then make a temporary List where you add the items from the 2nd IList before adding it to you final multidimensional list.<\/p>\n<pre class=\"lang:csharp\">var iList = ParseObjectClass.Get&lt;IList&lt;object&gt;&gt;(\"dataName\");  \/\/ Cast as Object IList\r\n\r\nList&lt;List&lt;string&gt;&gt; multiList = new List&lt;List&lt;string&gt;&gt;();  \/\/ Your final output.\r\n\r\n\r\n\r\nforeach( var item in iList ){    \r\n\r\n\tvar itemList = item as IList&lt;object&gt;;  \/\/ Cast item as another IList.\r\n\r\n\tList&lt;string&gt; tempList = new List&lt;string&gt;();  \/\/ Temp list.   \r\n\r\n\t\r\n\r\n\tforeach( var innerItem in tempList ){        \r\n\r\n\t\ttempList.Add(innerItem.ToString());    \/\/ Add to temp list.\r\n\r\n\t}    \r\n\r\n\tmultiList.Add(tempList );  \/\/ Add to final output.\r\n\r\n}\r\n\r\n\r\n\r\n\/\/ Print all items.\r\n\r\nfor( int i=0; i&amp;lt;multiList.Count; i++ ){    \r\n\r\n\tfor( int j=0; j&amp;lt;multiList[i].Count; j++ ){        \r\n\r\n\t\tDebug.Log(multiList[i][j]);    \r\n\r\n\t}\r\n\r\n};<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I recently found that you&#8217;re able to save multidimensional data to Parse. Saving the data wasn&#8217;t a problem though, but getting it back from a ParseObject took me a while before I finally got it working.<\/p>\n","protected":false},"author":1,"featured_media":54381,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1079,255],"tags":[2523,2524,749,2525,2433,2526,750,2527,1038,2528,1312,2529,1513,1523,1563,2009,2010,2519,2520,2521,2522],"class_list":["post-54342","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to-fix-stuff","category-technology","tag-parse-com","tag-get","tag-code","tag-multidimensional","tag-coding","tag-multi","tag-programming","tag-multidimen","tag-data","tag-ilist","tag-object","tag-parseobject","tag-list","tag-array","tag-how","tag-unity3d","tag-unity","tag-unity-3d","tag-c","tag-csharp","tag-parse"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/www.elwinlee.com\/blog\/wp-content\/uploads\/2017\/08\/Parse_Logo.png","jetpack_shortlink":"https:\/\/wp.me\/p1mtRf-e8u","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/posts\/54342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/comments?post=54342"}],"version-history":[{"count":41,"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/posts\/54342\/revisions"}],"predecessor-version":[{"id":54388,"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/posts\/54342\/revisions\/54388"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/media\/54381"}],"wp:attachment":[{"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/media?parent=54342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/categories?post=54342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/tags?post=54342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}