IOS iTunes file sharing and iositunes file sharing

Source: Internet
Author: User

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

 

 

 

 

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.