iOS face Question--model layer--what is the directory structure of the sandbox? What kind of occasions are they generally used for?
Source: Internet
Author: User
<span id="Label3"></p><p><p><strong><span style="font-size: 18px;">What is the directory structure of the sandbox? What kind of occasions are they generally used for?</span></strong></p></p><p><p>one, iOS sandbox mechanism</p></p><p><p>iOS apps can only access areas created for the app, inaccessible to other areas, and other Non-code files for the app are present in this directory, including pictures, properties files, plist,bundle,nib files, and so on, which is known as the sandbox (sandbox).</p></p> <ol> <ol> <li>Each app has its own storage space, which is the sandbox</li> <li>Apps can only access their own sandbox, not other areas</li> <li>If the application requires file operations, the files must be stored in the sandbox, especially the database files, which can be accessed when operating on the computer, but if they are available on a real machine, the database files must be copied to the Sandbox.</li> </ol> </ol><p><p>second, Open the Sandbox path</p></p><p><p>1.NSLog (@ "%@", nshomedirectory ()), The Program's sandbox path can be obtained through Nshomedirectory () in the program</p></p><p><p></p></p><p><p><span style="font-size: 14px;"></span></p></p><p><p>2. Go to the folder via Finder--when you get the path. enter the above path into the sandbox directory.</p></p><p><p></p></p><p><p>third, directory Structure</p></p><p><p>Sandbox by default there are three directory folders Documents,library,tmp and app files that can only be manipulated in the appropriate folder</p></p> <ul> <ul> <li>Documents: typically used to store files created in an application, such as database files, or file data that is browsed in a Program. If you make a backup, the files in this folder will be included;</li> <li>Library/preferences: store default settings and status information for the app;</li> <li>Library/cache: used to store cached files, the data in this folder will not be deleted when the app Exits. This folder is not included in the backup;</li> <li>tmp: storage of temporary files created instantly;</li> </ul> </ul><p><p>iOS face Question--model layer--what is the directory structure of the sandbox? What kind of occasions are they generally used for?</p></p></span>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service