IOS itunes File Share

Source: Internet
Author: User

It is well known that Apple does not allow users to view files, and files between different apps are not linked. From the computer to the mobile phone file, but also only through the open sandbox directory, to the corresponding application.

Sometimes we need to import the file into the app sandbox, or export the file from the sandbox. This requires that the app's settings are supported.

Features: Allows you to import files through itunes. You can view all the files under the sandbox.

Steps:

Add the Uifilesharingenabled key to the application's Info.plist file and set the key value to Yes.

If you want to create a new file under the sandbox

Nsfilemanager *filemanager =[Nsfilemanager Defaultmanager]; NSString*pathdocuments = [Nssearchpathfordirectoriesindomains (nsdocumentdirectory, Nsuserdomainmask, YES) ObjectAtIndex:0]; NSString*createpath = [NSString stringWithFormat:@"%@/weimage", pathdocuments]; //determines whether the folder exists, if it does not exist, creates    if(![[Nsfilemanager Defaultmanager] Fileexistsatpath:createpath])    {[FileManager Createdirectoryatpath:createpath withintermediatedirectories:yes Attributes:nil Error:nil]; } Else{NSLog (@"File is exists!"); }

 

IOS itunes File Share

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.