title: Swift - Unable to read/write from file
body: <p>I'm actually not sure whether I'm not able to read or unable to write. I'm pretty sure writing works. I'm using <strong>Swift</strong>.</p>
  
  <p><a href="https://github.com/ghostpotato/SE-UILabel-Nil" rel="nofollow">Here</a> are my project files.</p>
  
  <p>I'm trying to write an array of arrays to a file, and then read that array of arrays when the app launches. Here's my code for writing and reading, respectively. <code>listOfTasks</code> is my array of arrays variable.</p>
  
  <p>Writing:</p>
  
  <pre><code>let cocoaArray : NSArray = listOfTasks
  cocoaArray.writeToFile(String(fileURL), atomically: true)
  </code></pre>
  
  <p>Reading:</p>
  
  <pre><code>listOfTasks = NSArray(contentsOfFile: String(fileURL)) as! [Array&lt;String&gt;]
  </code></pre>
  
  <p><code>fileURL</code>:</p>
  
  <pre><code>let documentsDirectory = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask).last
  
  let fileURL = documentsDirectory!.URLByAppendingPathComponent("file.txt")
  </code></pre>
  
  <p>I'm happy to provide additional information as necessary. Thanks in advance!</p>