关于iPhone应用程序的理想数据库实现的问题 [英] Question regarding ideal database implementation for iPhone app

查看:163
本文介绍了关于iPhone应用程序的理想数据库实现的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个关于应用程序的理想设置的问题,我准备好构建。该应用程序基本上将是一个记忆工具,我已经有一个sqlite数据库的内容,我将用于该应用程序。

So I have a question about the ideal setup for an app I am getting ready to build. The app is basically going to be a memorization tool and I already have an sqlite database full of content that I will be using for the app.

用户将浏览数据库的内容(使用uipickerview),并选择要记住的内容。如果选择了该行或单元格的数据,则将其放入池或专用于显示需要记住池中的哪些项目的合适视图中。当您转到该表视图时,可以选择行,并填充实际数据。 tableview中的所有信息都是可删除的,如果他们不想要它在那里了...

The user will navigate through the contents of the database(using the uipickerview), and select something for memorization. If that row or cell of data is selected, it is put into a pool or a uitableview that is dedicated to showing which items you have in your "need to memorize" pool. When you go to that tableview, you can select the row, and the actual data would be populated. All information in the tableview would be deletable, in the event that they don't want it there anymore...

就是这样。

我知道使用数据库接口,有几个不同的选项,在这个特定的设置,是核心数据的最简单的方法?有什么其他方法会更好吗?

I know that with database interfacing, there are a few different options out there, in this particular setup, is core data the easiest approach? Is there any other way that would be better? I am just kind of looking for a point in the right direction, any help is greatly appreciated!!

推荐答案

核心数据正在进行中是最简单的。您将希望将数据从原始SQLite文件迁移到Core Data生成的SQLite文件,因为Core Data旨在100%管理其自己的文件。幸运的是,您可以在桌面上使用快速命令行应用程序执行此操作,然后将生成的Core Data Sqlite文件复制到您的应用程序包中,以供将来在iOS上使用。

Core Data is going to be the easiest. You will want to migrate your data from your raw SQLite file to a Core Data generated SQLite file as Core Data is designed to manage its own file 100%. Fortunately you can do this with a quick command line app on the desktop and then copy the resulting Core Data Sqlite file into your application bundle for later use on iOS.

在iOS上的SQLite是可能的,但是与Core Data提供的易用性相比真正的头痛。

Doing raw SQLite on iOS is possible but a real headache to get right compared to the ease of use that Core Data offers.

iOS上的Core Data会在桌面上生成与Core Data相同的文件。因此,您可以为桌面开发一个快速,简单的应用程序,例如,接受以下输入:

Core Data on iOS produces identical files to Core Data on the Desktop. Therefore you can develop a quick and easy app for the desktop that say for example takes the following inputs:


  • 表/实体名称

  • 一行数据的CSV

然后它将基于实体名称创建一个Core Data实体并将数据插入到该行中。

Then it would create a Core Data entity based on the entity name and insert the data into that row.

有了这个,就可以用一个bash脚本循环遍历所有表和这些表中的行创建新的SQLite文件。

With that in place it would be trivial to do a bash script to loop through the all of the tables and the rows in those tables to create your new SQLite file.

嗯,可能需要在 CIMGF 关于此:)

Hmmm, might have to do a blog post some time on CIMGF about this :)

这篇关于关于iPhone应用程序的理想数据库实现的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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