---
title: "Best way to find the user's Documents directory on an iPhone"  
description: "Best way to find the user's Documents directory on an iPhone"  
author: "Anonymous User"  
published: 2015-09-08  
updated: 2015-09-08  
canonical: https://www.mindstick.com/forum/33445/best-way-to-find-the-user-s-documents-directory-on-an-iphone  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# Best way to find the user's Documents directory on an iPhone

I have read an iPhone book there i find the [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server)'s [Documents](https://www.mindstick.com/articles/156931/the-main-types-of-business-documents) [directory](https://www.mindstick.com/forum/226/how-to-get-application-directory-using-c-sharp-csharp) is with the [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii):

[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];

but that seems slightly brittle, and dissimiliar to the normal [Mac](https://www.mindstick.com/articles/311752/how-to-install-and-use-the-google-wifi-software-on-a-windows-or-mac-computer) way of doing it, which would be:

NSSearchPathForDirectoriesInDomains(NSDocumentsDirectory, NSUserDomainMask, [YES](https://www.mindstick.com/forum/157763/how-to-return-yes-no-based-on-date-comparison-in-sql));

Is there any particular [reasons](https://www.mindstick.com/articles/13029/top-4-reasons-to-try-online-casinos) to use one over the other?

## Replies

### Reply by Anonymous User

Here is the code that I use in my framework.

```
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);NSString *documentsDirectory = [paths objectAtIndex:0];
```


---

Original Source: https://www.mindstick.com/forum/33445/best-way-to-find-the-user-s-documents-directory-on-an-iphone

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
