<p>I'm reading Erica Sadun's <em>iPhone Developer's Cookbook</em>, and ran into a question.</p>

<p>She says in the book that the way to find the user's Documents directory is with the code:</p>

<pre><code>[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
</code></pre>

<p>but that seems slightly brittle, and dissimiliar to the normal Mac way of doing it, which would be:</p>

<pre><code>NSSearchPathForDirectoriesInDomains(NSDocumentsDirectory, NSUserDomainMask, YES);
</code></pre>

<p>Are there any particular reasons to use one over the other?</p>

Objc:
```
```
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)
```
```
Swift:
```
```
var paths = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.UserDomainMask, true)
```
```
You'll want the first element of the returned array.