title: How to read a multidimensional array from a .plist file in macOS?
body: <p>In a macOS project I have to read the contents of a .plist file and insert it into a multidimensional array. Not having found much material for macOS, I read tutorials and questions oriented to iOS programming.</p>
  
  <p>I created a code that I thought could work, but when it comes to reading the contents of the file, it fails. What am I doing wrong? Thanks.</p>
  
  <pre><code> // Edited
  
   let filePath = documentDirectory + "/Docs/" + "MyFile" + ".plist"
   var resourceFileArray: NSArray?
  
   //load the content of the plist file
   if let path = Bundle.main.path(forResource: (filePath), ofType: "plist") {
       resourceFileArray = NSArray(contentsOfFile: path)
   }
  
   if let resourceFileArrayContent = resourceFileArray {
       print(resourceFileArrayContent)
   } else {
       print("error")     // it always falls here
   }
  </code></pre>
  
  <p>Content of the plist file:</p>
  
  <pre><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;array&gt;
      &lt;array&gt;
          &lt;string&gt;One&lt;/string&gt;
          &lt;string&gt;false&lt;/string&gt;
          &lt;string&gt;&lt;/string&gt;
          &lt;string&gt;&lt;/string&gt;
          &lt;string&gt;false&lt;/string&gt;
          &lt;string&gt;false&lt;/string&gt;
          &lt;string&gt;false&lt;/string&gt;
      &lt;/array&gt;
  &lt;/array&gt;
  &lt;/plist&gt;
  </code></pre>