SandBoxPathFile, sandboxie

Source: Internet
Author: User

SandBoxPathFile, sandboxie

// Obtain the sandbox directory of the application

NSArray * array = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES );

NSString * path = [array objectAtIndex: 0];

NSLog (@ "% @", path );

// Each application has its own sandbox directory, and applications cannot access the sandbox directories.

// Logs, Libray, and temp under the sandbox directory

// Files under the Documents directory will be backed up to the server and restored to the mobile phone together during itunes backup and recovery. files created in the program must be stored in the Documents directory.

// Libray stores the system library, and applications cannot use the Libray directory.

// Store temporary files in the tmp directory. When you restart the directory, all files in the tmp directory will be deleted.

NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: @ "a", @ "B", nil];

NSString * sandBoxPathFile = [NSString stringWithFormat: @ "% @/abc. plist", path];

// Write abc. plist to the Documents file in the sandbox directory of the application

[Dict writeToFile: sandBoxPathFile atomically: YES];

// Read the file

NSDictionary * readDict = [[NSDictionary alloc] initWithContentsOfFile: sandBoxPathFile];

NSLog (@ "% @", readDict );

 

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.