如果我制作了两个 iPhone 应用程序,我可以/应该如何在它们之间共享自定义数据(不是联系人之类的东西)?
If I make two iPhone applications, how can/should I share custom data (not contacts and stuff like that) among them?
谢谢!
推荐答案有两种不同的方法可以解决这个问题.
There are two different ways you might go about this.
1) 您需要共享的数据是非持久性的.换句话说,你需要用一段数据启动一个应用程序,它可以用它做一些事情.在这种情况下,您将为每个应用程序注册一个特殊的 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 在他的 [redacted] 博文中找到有关 URL 方案的更多信息.
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 应用程序之间共享自定义数据?
发布评论