Analysis on the issues that need to be paid attention to when searching the App path in iOS

Source: Internet
Author: User

Analysis on the issues that need to be paid attention to when searching the App path in iOS

The NSFileManager class provides a large number of iOS App file and Folder-related operations. All you need to do is create an instance object of this class.

I suggest youNoUse the shared file manager object (shared file manager) provided by the defaultManger class method to operate files and directories, because this object is not thread-safe.

The best way is to create and manage an NSFileManager instance variable.

Suppose you want to find the Documents directory in your App, you just need to write the following code:

NSFileManager * fileManager = [[NSFileManager alloc] init]; NSArray * urls = [fileManager URLsForDirectory: NSDocumentDirectory inDomains: NSUserDomainMask]; if ([urls count]> 0) {NSURL * documentsFolder = urls [0]; NSLog (@ "% @", documentsFolder);} else {NSLog (@ "cocould not find the specified ents folder. ");}

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.