覆盖数据库还是更新(iPhone)? [英] Overwrite database or update (iPhone)?

查看:85
本文介绍了覆盖数据库还是更新(iPhone)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于内容的只读iPhone应用程序。用户可以选择我需要跟踪的收藏主题。我希望通过App Store在两次应用更新之间提供一些主题。在App Store更新发布之前,我需要跟踪用户是否下载了这些特定主题。此方法将包含两个用于用户跟踪的表。所有其他表主要包含静态内容,保存所有新下载的条目。

I have a content based, read-only iPhone app. Users can select favorite topics, which I need to track. Some topics I'd like to make available between app updates through the App Store. I'll need to track if users have downloaded these particular topics or not until the App Store update is available. This approach will consist of two tables for user tracking. All other tables contain mainly static content, save any new downloaded entries.

在开始跟踪用户内容之前,我总是会在应用程序更新上部署数据库。覆盖-简单。但是现在我需要跟踪某些用户配置。我希望使用两个数据库,而不是试图跟踪用户拥有哪个应用程序版本并以正确的顺序浏览sql脚本列表,从而使用户使用正确的数据库版本。一个包含静态内容,另一个包含用户数据。静态内容数据库始终被覆盖。这使事情变得简单。该数据库当前为250kb。它将增长非常缓慢。

Before I began tracking user content, I'd always deploy the database on app updates. An overwrite - simple. But now I need to track certain user configurations. Rather than trying to keep track of which app version a user has and running through a list of sql scripts in the correct order, so the user is at the right database version, I'm thiking to use two databases. One contains static content and the other user data. The static content database is always overwritten. That keeps things simple. The database currently is 250kb. It will grow very slowly.

我还计划使用SDK 3.0推送通知和对等功能,它将在用户数据库中存储任何用户配置数据。

I have plans to use SDK 3.0 push notification and peer-to-peer as well, which will store any user config data in the user database.

有人看到这种方法有问题吗?

Any one see problems with this approach?

推荐答案

这对我来说听起来不错。如果使用的是SQLite,则可能需要查看 ATTACH DATABASE 命令,该命令可让两个数据库在同一连接上保持打开状态。

This sounds alright to me. If you're using SQLite, you may want to look into the ATTACH DATABASE command, which lets you keep two databases open on the same connection.

这篇关于覆盖数据库还是更新(iPhone)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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