iOS sandbox (sandbox) mechanism and get sandbox path

Source: Internet
Author: User

One, each iOS App SDK is limited in the "sandbox", "sandbox" is equivalent to a folder with only the owner visible permissions, Apple has the following restrictions on the sandbox.

(1), the application can operate in its own sandbox, but cannot access any other application's sandbox.

(2), data cannot be shared between applications, files in the sandbox cannot be copied to other application folders, and files in other application folders cannot be copied into the sandbox.

(3), Apple prohibits any read and write files outside the sandbox, and prohibits the application from writing content to a folder other than the sandbox.

(4), the sandbox root directory has three folders: documents, you should generally store the application's data files in this folder for storing user data or other information that should be backed up regularly. Library, there are two folders, the caches storage application launches the required information, preferences contains the application preferences file, but do not modify the preferences here. Temp, which holds the temporary file, that is, the application starts the unwanted file again.

Second, get the sandbox path

(1), the method to get the sandbox root directory, there are the following:

1, using Nshomedirectory to obtain

2. Access by user name

(2), Get document Path

(3), get the TMP path

(4), get the cache path

iOS sandbox (sandbox) mechanism and get sandbox path

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.