IOS iTunes file sharing and iositunes file sharing
As we all know, Apple does not allow users to view files, and there is no link between different applications. You can only upload files from your computer to your mobile phone by opening the sandbox directory to the corresponding application.
Sometimes we need to import the file to the application sandbox or export the file from the sandbox. This requires application settings.
Function: allows you to import files through iTunes. You can view all files in the sandbox.
Steps:
Add the UIFileSharingEnabled key to the Info. plist file of the application, and set the key value to YES.
To create a file in the sandbox
NSFileManager * fileManager = [NSFileManager defaultManager]; NSString * pathDocuments = [constraint (NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex: 0]; NSString * createPath = [NSString stringWithFormat: @ "% @/WEImage", pathDocuments]; // determines whether a folder exists. if it does not exist, create if (! [[NSFileManager defaultManager] fileExistsAtPath: createPath]) {[fileManager createDirectoryAtPath: createPath withIntermediateDirectories: YES attributes: nil error: nil];} else {NSLog! ");}