title: Writing to file fails
body: <p>I'm trying to write an NSMutableArray to a file, however it fails every single time. I believe that the path I have stated is correct. What else could be the problem?</p>
  
  <pre><code>for (int i=1; i&lt;=10/*[self getcurrentnumber]*/;i++)
  {
      [mutablearray addObject:[self convertJSONtoDictionary:[self generateJSONforcomic:[NSNumber numberWithInt:i]]]];
      NSLog(@"Iteration %i",i);
  }
  NSLog(@"Done %.0u",[mutablearray count]);
  
  NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
  NSString *libraryDirectory = [paths objectAtIndex:0];
  NSString *location = [libraryDirectory stringByAppendingString:@"/Comics.txt"];
  NSLog(location);
  [mutablearray writeToFile:location atomically:YES];
  if(![mutablearray writeToFile:location atomically:YES])NSLog(@"Fail");
  </code></pre>
  
  <p>I'm using introspection to ensure that convertJSONtoDictionary actually returns a dictionary.</p>