title: cocos2d-x how to read plist into an array
body: <p>i want to read a plist using cocos2d-x (c++)
  here is my plist: </p>
  
  <pre><code>&lt;array&gt;
      &lt;dict&gt;
          &lt;key&gt;x&lt;/key&gt;
          &lt;integer&gt;0&lt;/integer&gt;
          &lt;key&gt;y&lt;/key&gt;
          &lt;integer&gt;0&lt;/integer&gt;
      &lt;/dict&gt;
      &lt;dict&gt;
          &lt;key&gt;x&lt;/key&gt;
          &lt;integer&gt;140&lt;/integer&gt;
          &lt;key&gt;y&lt;/key&gt;
          &lt;integer&gt;12&lt;/integer&gt;
      &lt;/dict&gt;
      &lt;dict&gt;
          &lt;key&gt;x&lt;/key&gt;
          &lt;integer&gt;120&lt;/integer&gt;
          &lt;key&gt;y&lt;/key&gt;
          &lt;integer&gt;280&lt;/integer&gt;
      &lt;/dict&gt;
      &lt;dict&gt;
          &lt;key&gt;x&lt;/key&gt;
          &lt;integer&gt;40&lt;/integer&gt;
          &lt;key&gt;y&lt;/key&gt;
          &lt;integer&gt;364&lt;/integer&gt;
      &lt;/dict&gt;
  &lt;array&gt;
  </code></pre>
  
  <p>it's basically an array of dictionary that consist of (x, y) coordinates. 
  my original code for reading is: </p>
  
  <pre><code>NSString *path = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"w%i", world] ofType:@"plist"];
  NSMutableArray* points = [NSMutableArray arrayWithContentsOfFile:path];
  </code></pre>
  
  <p>but Now i need to translate it into cocos2d-x in c++. i've googled some article but they are all about reading plist into dictionary. i need an array. </p>
  
  <p>EDIT:::</p>
  
  <p>Now i've changed my plist format:</p>
  
  <pre><code>&lt;dict&gt;
      &lt;key&gt;11x&lt;/key&gt;
      &lt;integer&gt;0&lt;/integer&gt;
      &lt;key&gt;11y&lt;/key&gt;
      &lt;integer&gt;0&lt;/integer&gt;
      &lt;key&gt;12x&lt;/key&gt;
      &lt;integer&gt;140&lt;/integer&gt;
      &lt;key&gt;12y&lt;/key&gt;
      &lt;integer&gt;12&lt;/integer&gt;
  &lt;dict&gt;
  </code></pre>
  
  <p>what should i do??? I still get the same error: </p>
  
  <pre><code>CCDictionary&lt;std::string, CCObject*&gt;* dict = CCFileUtils::dictionaryWithContentsOfFile(plistPath);
  int x = (int)dict-&gt;objectForKey("11x");
  int y = (int)dict-&gt;objectForKey("11y");
  </code></pre>
  
  <p>won't work. 
  Please try it out first. see if you can read a int from the sample plist</p>