For security reasons, iOS restricts each application to a specific file. Other apps do not have the permission to access this folder. This is the sandbox of the app.
Common file directories for iOS apps:
<Home>/AppName. app package directory
<Home>/Documents/important data files and user data files of applications are stored in this directory. When iTunes backs up and recovers, this directory is copied.
<Home>/Library/Preferences: stores preference files of the app and files generated using the NSUserDefaults class.
<Home>/Library/Caches is used to store support files and cache files generated during app usage. It is recommended that you store log files in this directory. ITunes will not back up this directory file.
<Home>/tmp/is used to store temporary files and will not be backed up. The system may clear this directory.
Note: Generally, the most important and not huge files are stored in the Documents directory. Otherwise, it takes a long time for iTunes backup.
Use System APIs to access folders in sandbox
NSArray * paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES );
NSString * documentsDirectory = [paths objectAtIndex: 0];
Common search path constant: www.2cto.com
NSDocumentDirectory <Application_Home>/Documents
NSCachesDirectory <Application_Home>/Library/Caches
Nsapplicationsuppdirectory directory <Application_Home>/Library/Application Support