title: Getting list of files in documents folder
body: <p>What is wrong with my code for getting the filenames in the document folder?</p>
  
  <pre><code>func listFilesFromDocumentsFolder() -&gt; [NSString]?{
      var theError = NSErrorPointer()
      let dirs = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.AllDomainsMask, true) as? [String]
      if dirs != nil {
          let dir = dirs![0] as NSString
          let fileList = NSFileManager.defaultManager().contentsOfDirectoryAtPath(dir, error: theError) as [NSString]
          return fileList
      }else{
          return nil
      }
  }
  </code></pre>
  
  <p>I thought I read the documents correctly and I am very sure about what is in the documents folder, but "fileList" does not show anything? "dir" shows the path to the folder.</p>