title: NSFileManager fileExistsAtPath:isDirectory issue
body: <p>Can someone help me understand what I'm doing wrong with this method?</p>
  
  <p>I'm trying to recursively detect the contents of directories and create an xml file in each one. Non-recursive works perfectly and outputs proper xml files. Recursive chokes on dir detection and add's all files + dir's under the "directories" element.</p>
  
  <pre><code>_dirArray = [[NSMutableArray alloc] init];
  _fileArray = [[NSMutableArray alloc] init];
  
  NSError *error;
  NSFileManager *filemgr = [NSFileManager defaultManager];
  NSArray *filelist = [filemgr contentsOfDirectoryAtPath:dirPath error:&amp;error];
  
  for (int i = 0; i &lt; filelist.count; i++)
  {   
      BOOL isDir;
      NSString *file = [NSString stringWithFormat:@"%@", [filelist objectAtIndex:i]];
      [_pathToDirectoryTextField stringValue], [filelist objectAtIndex:i]];
  
      if ([filemgr fileExistsAtPath:dirPath isDirectory:&amp;isDir] &amp;&amp; isDir) // I think this is what is crapping out.
      {
          [_dirArray addObject:file];
      }
      else
      {
          if ([file hasPrefix:@"."])
          {
              // Ignore file.
          }
          else
          {
              [_fileArray addObject:file];
          }
      }
  }
  </code></pre>
  
  <p>Thanks for any tips guys.</p>