如何在iPhone应用程序之间共享自定义数据? [英] How to share custom data between iPhone applications?

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

问题描述

如果我制作两个iPhone应用程序,我应该如何/应该共享自定义数据(不是联系人和类似的东西)?

If I make two iPhone applications, how can/should I share custom data (not contacts and stuff like that) among them?


推荐答案

有两种不同的方式。

您需要共享的数据是非持久性的。换句话说,你需要启动一个应用程序与一块数据,它可以做一些事情。在这种情况下,您将为每个应用程序注册一个特殊的URL方案。

1) The data you need to share is non-persistent. In other words you need to launch one application with a piece of data that it can do something with. In this case you would register a special URL scheme per application.

您可以通过Craig Hockenberry在他的 博文

You can find out more information about URL schemes via Craig Hockenberry in his [redacted] blog post.

2)数据你需要共享是持久的。换句话说,你需要一个数据文件,这两个应用程序都可以读写。据我所知,除了将数据存储在远程服务器上之外,没有一种安全的方法可以做到这一点。如果您需要无需数据连接即可访问数据,则需要找出在各个应用和远程服务器之间同步数据的方法。

2) The data you need to share is persistent. In other words you need something like a data file that both applications can read and write too. As far as I know there isn't a safe way to do this other than storing your data on a remote server. If you need the data accessible without a data connection then you would need to figure out a way to sync data between the individual apps and the remote server.

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

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