iCloud Integration用于上传和下载文件 [英] iCloud Integration for uploading and downloading files

查看:136
本文介绍了iCloud Integration用于上传和下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设计一个应用程序,用于在 iCloud 上存储文档。但在实际实施之前有一些问题已经回答。

I want to design an app which stores documents on iCloud. But there are some question which has answer before doing actual implementation.

问题如下,


  1. iCloud上传的最大文件大小是多少?

  2. 我能否以编程方式计算/了解用户
    iCloud的可用空间帐户?

  3. 如何从
    iCloud上传和下载文件?

有人可以帮我吗?我阅读了苹果文档,但没有完全理解所有内容。

Can anyone please help me here ? I read the apple documentation but not understood all the things completely.

提前谢谢。

推荐答案

虽然您提到过您已阅读过Apple icloud文档,但设计icloud文档页面仍然是这个问题的一个很好的起点。

Although you mentioned you've read the apple icloud documentation, the designing for icloud documentation page from Apple is still a good starting point for this question.

文件大小限制

文档未指定文档文件大小限制,也未指定核心数据存储限制,除了用户帐户icloud存储限额。 密钥值存储有一个限制,对于一个值(在一个值 - 密钥对中)是1Mb,这可能是一个问题,但是否则它似乎可以存储大文件,只要用户有足够的可用空间。

The documentation doesn't specify a Document file size limit, nor a Core Data storage limit, other than a user account icloud storage allowance. There is a limit for Key Value storage which is 1Mb for a value (in a value-key pair), which could be an issue for you, but otherwise it seems you can store large files as long as the user has enough space available.

鉴于5gb默认金额并考虑到默认用户存储需求(照片,联系人,日历等),您可能会遇到限制对于文档核心数据存储,与任何其他应用程序一样。 icloud文件管理页面提到了良好的应用行为:

Given the 5gb default amount and accounting for the default user storage needs (photos, contacts, calendars and the like), you may encounter limits for Document and Core Data storage, like any other app. The file management for icloud page mentions good app behaviour:


利用iCloud存储功能的应用程序在存储数据时应负责任地执行
。每个
用户帐户中的可用空间有限,并由所有应用共享。此外,
用户可以查看给定应用程序消耗了多少空间,并选择
删除与您的应用程序关联的文档和数据。出于这些原因,
对您的b $ b商店中的哪些文件负责是您的应用程序的利益。

Apps that take advantage of iCloud storage features should act responsibly when storing data in there. The space available in each user’s account is limited and is shared by all apps. In addition, users can see how much space is consumed by a given app and choose to delete documents and data associated with your app. For these reasons, it is in your app’s interest to be responsible about what files you store.

以编程方式检查可用空间

上传/下载活动

文件上传和下载由操作系统处理。所有文件都存储在本地,它来自您请求/修改/保存文档的本地存储。从icloud基础知识页面:

The file uploading and downloading is handled by the OS. All files are stored locally, it's from this local store that you request/modify/save documents. From the icloud fundamentals page:


当您采用iCloud时,操作系统启动并管理
上传和下载数据附加到
iCloud帐户的设备。您的应用程序不直接与iCloud
服务器通信,并且在大多数情况下,不会调用上传或下载
数据。

When you adopt iCloud, the operating system initiates and manages uploading and downloading of data for the devices attached to an iCloud account. Your app does not directly communicate with iCloud servers and, in most cases, does not invoke upload or download of data.

有关键值存储集成的示例,请参阅此 app coda 教程,这个用于核心数据存储集成的 Tim Roadley 教程或者 Ray Wenderlich 文档商店集成教程。

See this app coda tutorial for an example of key-value store integration, this Tim Roadley tutorial for Core Data store integration or this Ray Wenderlich tutorial for Document store integration.

编辑:基于文档的应用编程指南iOS 提供了代码片段,用于将文件移入/移出iCloud,上传和下载以及监视文件更改。请参阅从iCloud下载文档文件和将文档移动到iCloud存储。

The Document-Based App Programming Guide for iOS provides code snippets for moving files to/from iCloud, uploading and downloading as well as monitoring file changes. See "Downloading Document Files from iCloud" and "Moving a Document to iCloud Storage".

这篇关于iCloud Integration用于上传和下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆