<p>The iPhone provides a comprehensive set of operations for working with files and directories. <strong>NSFileManager</strong> includes methods for querying the contents of directories, creating, renaming and deleting contents, as well as getting/setting file attributes (readable, writeable, etc).</p> <h5>Point to the Documents Directory</h5> <p>Each application has its own sandbox in which you can read/write files. Files written to the sandbox are persistent across invocations of the application, including across application updates.</p> <p>You can locate the Documents directory in the sandbox as shown below:</p> <div><div><pre style="font-family:monospace"><span style="color:#11740a;font-style:italic">// For error information</span> <span style="color:#400080">NSError</span> <span style="color:#002200">*</span>error; <span style="color:#11740a;font-style:italic">// Create file manager</span> <span style="color:#400080">NSFileManager</span> <span style="color:#002200">*</span>file