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. ");}