title: NSDictionary writeToFile fails while objects are valid, permission is 0k
body: <p>Why <code>NSDictionary</code> cannot be written?? I have checked the content of the dictionary: all the instances are of <code>NSString</code> and <code>NSNumber</code>. I checked permissions: a text file with the same name at the same path is written well. Of course, my dictionary is not empty.</p>
  
  <pre><code>NSString *file = ...
  NSDictionary *dict = ...
  
  // check dictionary keys
  BOOL wrong = NO;
  for (id num in [dict allKeys]) {
      if (![num isKindOfClass:[NSNumber class]]) {
          wrong = YES;
          break;
      }
  }
  if (wrong) {
      NSLog(@"First");
  }
  // check dictionary values
  wrong = NO;
  for (id num in [dict allValues]) {
      if (![num isKindOfClass:[NSString class]]) {
          wrong = YES;
          break;
      }
  }
  if (wrong) {
      NSLog(@"Second");
  }
  
  if (![dict writeToFile:file atomically:YES]) {
      // 0k, let's try to create a text file
      NSLog(@"Names writing error!");
      [@"Something here... .. ." writeToFile:file atomically:YES encoding:NSUTF8StringEncoding error:nil];
  }
  </code></pre>
  
  <p>Output: "Names writing error!"<br>
  Text file is created successfully.</p>