iOS applications have a limited number of directories available for writing content, the design intent is to ensure application security. This post will give a quick run down of the folder locations available in an iOS application and their intended use.
Documents Directory – ApplicationHome/Documents
The Documents directory is the primary location to save user and application related content. This directory and its subdirectories, are backed up when a user does a sync with iTunes. This is directory is also the repository for iTunes file sharing content.
The code below shows how to check for and print the path to the Document directory:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
if ([paths count] > 0)
NSLog(@"Documents directory: %@", [paths objectAtIndex:0] );
Documents Inbox – ApplicationHome/Documents/Inbox
The Documents Inbox is primarily used when an application such as the Mail app calls your app with a request to open a specific file type.
The content in the Library directory is backed up when a device is synced with iTunes.
tmp – ApplicationHome/tmp
As the name implies, the tmp directory is available for files that are used only while your application running. A good practice would be to remove any files that you create here (before exiting your app). iOS may also clean this directory, however, this is not guaranteed.
The content in the tmp directory is not backed up when a device is synced with iTunes.
Library – ApplicationHome/Library
The Library directory is for intended for content that is not user generated. For example, if you have data that is read into your application at app startup, this would be a good place to store such information.
The content in the Library directory is backed up when a device is synced with iTunes, with one exception, there is a Caches directory that is not backed up.I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.
Stay tuned to my blog, twitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.
Documents Directory – ApplicationHome/Documents
The Documents directory is the primary location to save user and application related content. This directory and its subdirectories, are backed up when a user does a sync with iTunes. This is directory is also the repository for iTunes file sharing content.
The code below shows how to check for and print the path to the Document directory:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
if ([paths count] > 0)
NSLog(@"Documents directory: %@", [paths objectAtIndex:0] );
Documents Inbox – ApplicationHome/Documents/Inbox
The Documents Inbox is primarily used when an application such as the Mail app calls your app with a request to open a specific file type.
The content in the Library directory is backed up when a device is synced with iTunes.
tmp – ApplicationHome/tmp
As the name implies, the tmp directory is available for files that are used only while your application running. A good practice would be to remove any files that you create here (before exiting your app). iOS may also clean this directory, however, this is not guaranteed.
The content in the tmp directory is not backed up when a device is synced with iTunes.
Library – ApplicationHome/Library
The Library directory is for intended for content that is not user generated. For example, if you have data that is read into your application at app startup, this would be a good place to store such information.
The content in the Library directory is backed up when a device is synced with iTunes, with one exception, there is a Caches directory that is not backed up.I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.
Stay tuned to my blog, twitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.
[iPhone Development][iOS Development][Objective C Programming]
No comments:
Post a Comment