File-Sharing Support on iOS Devices (iOS 4 only)

本文介绍如何使用iTunes 9.1及更高版本在iOS设备(如iPhone、iPad和iPod touch)上支持文件共享的应用程序之间进行文件传输。通过将UIFileSharingEnabled键添加到应用程序的Info.plist文件中并设置为YES,可以启用文件共享功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

File-Sharing Support

Applications that want to make user data files accessible can do so using application file sharing. File sharing enables the application to expose the contents of its /Documents directory to the user through iTunes. The user can then move files back and forth between the iPad and a desktop computer. This feature does not allow your application to share files with other applications on the same device, though. To share data and files between applications, you must use the pasteboard or a document interaction controller object.

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

  1. Add the UIFileSharingEnabled key to your application’s Info.plist file and set the value of the key to YES.

  2. Put whatever files you want to share in your application’s Documents directory.

  3. When the device is plugged into the user’s computer, iTunes 9.1 displays a File Sharing section in the Apps tab of the selected device.

  4. The user can add files to this directory or move files to the desktop.

Applications that support file sharing should be able to recognize when files have been added to the Documents directory and respond appropriately. For example, your application 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.


Starting with iOS 3.2 on iPad, Apple introduced a file sharing technology (UIFileSharingEnabled) that allows an application to expose its Documents directory to the user through iTunes. The user can then move files back and forth between their device and their computer. Moreover, iOS 4 has brought this feature to both iPhone and iPod touch.

You can learn more about iTunes file sharing in the File-Sharing Support section of What's New in iPhone OS.

iTunes file sharing does not, however, solve all document transfer problems. For example:

  • It requires iOS 3.2 or later. If you must support older versions of iOS, file sharing is not an option.

  • It does not support device-to-device document transfers.

  • It is only supported over USB; the user has to plug in their device.


-----------------

相关链接:

http://support.apple.com/kb/HT4094


Summary

Using iTunes 9.1 or later, you can copy files between your computer and apps on your iOS device that support File Sharing (for example, Pages for iPad supports File Sharing, so you can create a document in Pages on your iPad, then copy it to your Mac so you can open it in Pages for Mac OS X). This article explains how to copy files between your computer and your iOS device using File Sharing.

Products Affected

iPhone, iPad, iPod touch

File Sharing requires
  • The latest version of iTunes
  • Mac OS X v10.5.8 or later or an up-to-date version of Windows XP, Windows Vista, or Windows 7
  • An iOS device (with the latest version of iOS)
  • An iOS application that supports File Sharing
How to copy files using File Sharing
  1. Connect your iOS device to your computer using the included Dock Connector to USB cable.
  2. Launch iTunes 9.1 or later on your computer.
  3. Select your iOS device from the Devices section of iTunes.

  4. Click the Apps tab and scroll down to the bottom of the page. 
    Note: If you do not see the File Sharing section shown in the image below, your iOS device does not have any apps that support File Sharing.

  5. Under the File Sharing section, you'll find a list of apps currently installed on your iOS device that support File Sharing. Select an app to view a list of the files associated with that app on your iOS device.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值