如何使用与另一个数组的数据匹配的数据更新数组
我来自数据库程序员新手,主要使用 MS Access 进行带有表单的简单数据库应用程序。我正在迁移到 Xcode,需要一些帮助来填充和更新我计划使用一个大数组的数据源。
我已将 sqlite 中的所有原始数据加载到对象中:类别、主题、报价、Quote_Map
Category
---------
category_id
category_name
subject
--------
subject_id
subject_name
category_name
quote
--------
quote_id
quote_excerpt
quote_map
----------
quote_map_id
quote_id
subject_id
现在,每个表都有对象。现在我想创建一个具有以下所有内容的主数据源对象:
category_data
----------
category_title
subjects (array)
然后在我想要的category_subjects数组中:
subjects
----------
subject_id
subject_title
category_title
quotes (array)
引号显然只是那些映射到quote_map表中的主题的引号。
在我完全走上错误的方向之前,我想寻求一些指导来了解完成这项任务的最佳方法是什么。
我试图最终得到一个数据源,我可以将其用于具有四个视图、类别、然后是该类别的主题、然后是该主题的引用、然后是所选的特定引用的向下钻取应用程序。
任何方向将不胜感激。
I am coming from a novice database programmer background, mainly using MS Access for simple database applications with forms. I am in process of migrating to Xcode and need some assistance in how to populate and update my datasource which I planned to use one big array for.
I have all my raw data from sqlite loaded into Objects: Category, Subject, Quote, Quote_Map
Category
---------
category_id
category_name
subject
--------
subject_id
subject_name
category_name
quote
--------
quote_id
quote_excerpt
quote_map
----------
quote_map_id
quote_id
subject_id
I have objects for each of these tables now. Now I want to make a master data source object that has all the the following:
category_data
----------
category_title
subjects (array)
then within the category_subjects array I want:
subjects
----------
subject_id
subject_title
category_title
quotes (array)
The quotes are obviously just those that map to subjects from the quote_map table.
Before I get totally down a wrong direction I wanted to ask for some guidance on what the best way to go about this task is.
I am trying to end up with one data source that I can use for a drill down app with four views, category, then the subjects of that category, then the quotes of that subject, then the specific quote selected.
Any direction would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好的方向是基于 构建数据引擎核心数据。
花 2-4 小时,构建简单的测试项目,获得终身受益的经验。
Best direction to go is to build your data engine based on CoreData.
Spend 2-4 hours, build simple test project, get experience for lifetime.