Sandbox mechanism of IOS, iossandbox

Source: Internet
Author: User

Sandbox mechanism of IOS, iossandbox

Every App in IOS has a separate closed folder called sandbox, and Apple requires that no App can access the sandbox of other apps.

Sandbox directory

FOUNDATION_EXPORT NSString * NSHomeDirectory (void );

Or

Specifies the NSSearchPathDirectory enumerated value to search for subdirectories in the sandbox.

NSSearchPathDomainMask enumeration value, specifying the search range

Whether expandTilde expands the Tilde ~ (Whether to expand the full path)

NSArray * NSSearchPathForDirectoriesInDomains (NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, BOOL expandTilde)

 

The Sandbox directory contains the following three directories:

  • Documents stores long-term files
  • The Library system temporarily stores files
  • Tmp temporary files. files in this directory are cleared when the App restarts.

Other Path access methods in the sandbox

App Directory: [[NSBundle mainBundle] bundlePath]

Resource file path: [[NSBundle mainBundle] pathForResource: ofType: inDirectory: forLocalization:] All parameters are strings. This method has multiple reloads.

Tmp path: NSTemporaryDirectory ()

 

Related Article

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.