title: How to fill an NSArray with directory names?
body: <p>I'm looking for a way to fill an NSArray with NSStrings that are the names of the directories in the apps documents directory. </p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *documentsDirectory = [paths objectAtIndex:0];
  
      for (//loop until no more directories)
      {
           NSString *newDir = [documentsDirectory stringByAppendingPathComponent:path];
  
           //Code for retrieving directory names
           [directoriesArray addObject:newDir]; 
      }
  </code></pre>
  
  <p>I'm not sure what the for loop's conditions need to be and I'm not sure how to retrieve the directories names.</p>
  
  <p>Thanks for the advice in advance.</p>