美文网首页
iOS 支持文件共享

iOS 支持文件共享

作者: zjunchao | 来源:发表于2016-06-13 16:38 被阅读151次

    如需要支持文件共享,需要在info.plist 文件中增加
    添加Application supports iTunes file sharing,设置为YES

    File-Sharing Support
    File-sharing support lets apps make user data files available in iTunes 9.1 and later. An app that declares its support for file sharing makes the contents of its /Documents directory available to the user. The user can then move files in and out of this directory as needed from iTunes. This feature does not allow your app to share files with other apps on the same device; that behavior requires the pasteboard or a document interaction controller object.

    To enable file sharing for your app, do the following:

    Add the UIFileSharingEnabled key to your app’s Info.plist file, and set the value of the key to YES.
    Put whatever files you want to share in your app’s Documents directory.
    When the device is plugged into the user’s computer, iTunes displays a File Sharing section in the Apps tab of the selected device.
    The user can add files to this directory or move files to the desktop.
    Apps that support file sharing should be able to recognize when files have been added to the Documents directory and respond appropriately. For example, your app might make the contents of any new files available from its interface. You should never present the user with the list of files in this directory and ask them to decide what to do with those files.

    For additional information about the UIFileSharingEnabled key, see Information Property List Key Reference.

    相关文章

      网友评论

          本文标题:iOS 支持文件共享

          本文链接:https://www.haomeiwen.com/subject/femydttx.html