在iOS上的应用之间共享数据 [英] Sharing data between apps on iOS

查看:115
本文介绍了在iOS上的应用之间共享数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个共享通用数据(图像,声音文件等)的小型应用程序。此数据使每个应用程序的大小膨胀。当用户安装了2个或更多这些应用程序时,它们会使用重复的数据占用设备空间。有没有一种方法可以在我的应用程序之间共享此数据,以使每个应用程序都不复制其捆绑包中的数据?

I have several small apps that share common data (images, sounds files, etc). This data bloats the size of each app. When the user installs 2 or more of these apps that will bloat the device space with duplicate data. Is there a way that I can share this data between my apps so that each app doesn't duplicate this data within its bundle?

推荐答案

您可以通过使用应用程序组在应用程序之间使用公共文件空间。可以在以下位置找到如何使用它们的示例:在以下位置的应用之间共享数据iOS

You can have a common file space between apps by using app groups. An example of how to use them can be found here: Sharing data in between apps in IOS

您可以将其用作解决方案的一部分,以免在每个捆绑包中复制数据。一种方法是将数据托管在某处的服务器上,并且在安装应用程序后,您可以检查应用程序组中的公共数据,如果不存在,则可以下载并将其存储在其中。然后,安装的下一个应用程序将具有可用数据。这应该有助于避免将其包含在每个小型应用程序中。

You can use this as part of a solve for not duplicating the data in every bundle. One way might be to have the data hosted on a server somewhere and when the app is installed you can check the App Group for the common data, if it is not there, you can download it and store it there. Then the next app that is installed will have the data already available. This should help avoid having to include it in every small app.

您可以设置代码来检查共享位置,并在框架中下载数据并在所有应用程序之间共享它们,从而使维护起来更加容易。如果您还没有内容管理系统,则可以通过Google搜索一些支持iOS的系统。有很多。然后,您将在其中托管共享数据。这样,您便可以在每个应用程序处于现场时为其更新数据,这可以节省时间。但是,如果这些应用程序很小,则可能会过大。

You can set up the code to check the shared location and download the data in a framework and share it between all your apps making it a bit easier to maintain. If you do not already have a content management system then you could google for a few that have iOS support. There are many out there. You would then host the shared data there. This would give you the ability to update the data for each app while they are in the field which could be a time saver. If these apps are very small though, this may be overkill.

这篇关于在iOS上的应用之间共享数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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