title: How to get a `NSURL` of the document directory?
body: <p>I have the following code:</p>
  
  <pre><code>+(NSURL*) getRecordingDirectory {
      NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString* documentsDirectory = [paths objectAtIndex:0];
      NSURL* url = [[NSURL alloc] initWithString:documentsDirectory]; //&lt;-- nil
      return url;
  }
  </code></pre>
  
  <p>The line <code>NSURL* url = [[NSURL alloc] initWithString:documentsDirectory];</code> Doesn't seem to work. <code>url</code> remains <code>nil</code> after the line. </p>