title: How to read Array from plist iOS
body: <p>I am trying to read plist which contains array</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
  &lt;key&gt;key1&lt;/key&gt;
  &lt;string&gt;value1&lt;/string&gt;
  &lt;key&gt;key2&lt;/key&gt;
  &lt;string&gt;value2&lt;/string&gt;
  &lt;key&gt;keyarray1&lt;/key&gt;
  &lt;array&gt;
      &lt;string&gt;keyitem1&lt;/string&gt;
      &lt;string&gt;keyitem2&lt;/string&gt;
  &lt;/array&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>when i try to read valueForKey:@"keyarray1", I get null value. 
  I tried to read as a string and array nut no use.</p>
  
  <p>My Code</p>
  
  <pre><code>NSDictionary * values=[[NSDictionary alloc] initWithContentsOfFile:@"values.plist"];
  NSArray *arrayValues=[[NSArray alloc] initWithArray:[values valueForKey:@"keyarray1"]];
  </code></pre>