在两个或更多iPhone应用程序之间共享数据 [英] Share data between two or more iPhone applications

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

问题描述

这可以在同一设备上的两个应用程序之间共享数据吗?

Is this possible to share data between two applications on the same device?

或者我可以允许其他一些应用程序使用我的应用程序的信息/数据或任何其他应用程序方式?

Or can I allow some other application to use my application's information / data or in any other way?

例如,第一个应用程序用于事件管理,我用它来保存一些事件。第二个应用程序用于提醒,它将从其他应用程序获取数据,以便提醒我有关事件的信息。

For example, the first application is for event management, and I use it to save some event. The second application is for reminders, which will get data from the other application in order to remind me about the event.

这只是一个简单的例子,而不是真实场景。

This is just a simple example, not a real scenario.

推荐答案

从历史上看,iPhone一直试图阻止应用程序之间的数据共享。这个想法是,如果你无法获得另一个应用程序的数据,你就不会对该应用程序做任何坏事。

Historically, the iPhone has tried to prevent data sharing between apps. The idea was that if you couldn't get at another app's data, you couldn't do anything bad to that app.

在最近的IOS版本中,他们已经松了一点​​。例如,iOS编程指南现在有一个部分,通过让一个应用程序声明某个URL前缀,然后让其他应用程序引用该URL来在应用程序之间传递数据。因此,也许您将事件应用设置为回答event://网址的方式与网络服务器回答http://网址的方式相同。

In recent releases of IOS, they've loosened that up a bit. For example, the iOS programming guide now has a section on passing data between apps by having one app claim a certain URL prefix, and then having other apps reference that URL. So, perhaps you set your event app to answer "event://" URLs the same way that a webserver answers for "http://" URLs.

Apple的文档该方法是此处

Apple's documentation of that approach is here.

查看实施自定义网址方案。

Have a peek under "Implementing Custom URL Schemes".

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

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