How to open the sandboxed path of the program

Source: Internet
Author: User

The first way to open a sandboxed path for a program Nssearchpathfordirectoriesindomains

Address is a string
The first parameter is the enumeration value, which enumerates the folders you want to find "which folder to go directly to modify its enumeration value NSDocumentDirectory: To enter the document folder"
Second parameter: Nsuserdomainmask represents the user's home directory
Third parameter: General set to Yes means full path is shown
Nssearchpathfordirectoriesindomains Find the sandbox path, the return value is an array, the array contains only one element, this element is the path, directly using the subscript to take out.
The second way to open the sandboxed path of the application
First step: Locate the Home directory folder
NSString *homepath = Nshomedirectory ();
NSLog (@ "HomePath =%@", HomePath);

Step two: Then stitch the folder name you want to enter
NSString *documentpathtwo = [HomePath stringbyappendingpathcomponent:@ "Documents"];
NSLog (@ "documentpathtwo =%@", documentpathtwo);

Find a library
NSString *librarypath = [HomePath stringbyappendingpathcomponent:@ "library/caches"];
NSLog (@ "%@", LibraryPath);

How to find a special folder
NSString *tmppath = Nstemporarydirectory ();
NSLog (@ "%@", Tmppath);


Breakpoints Print the file path you want

or right-click to open

How to open the sandboxed path of the program

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.