数据组织成文件夹/文件式结构,目标 c

发布于 2024-12-18 07:56:58 字数 392 浏览 4 评论 0原文

我有大约 20,000 个 NSDictionary。每个字典包含三个 NSString。这些词典以类似文件夹文件的结构进行组织,即,我有大约二十个主要组,并且在每个组中我还有另外二十个子组。在每个子组中,我都有一个属于该子组的 NSDictionary 列表。

这些数据都是静态的,但有时会通过下载更新版本的数据进行更新。

用户不一定每次使用应用程序时都与这些数据进行交互,但在每次使用应用程序期间将始终显示主“组”。

所以我的问题:存储这些数据然后在必要时加载它的最佳方法是什么?起初我想把它全部放在一个 plist 中,然后在应用程序打开时从这个 plist 创建一个 NSArray ,但我想知道这是否会很慢。由于用户可能永远不会与此列表交互,也许替代方法更好?

I have about 20,000 NSDictionarys. Each dictionary contains three NSStrings. The dictionaries are organized in a folder-file like structure, i.e., I have about twenty main groups, and in each group I have another twenty sub-groups. Within each sub-group, I have a list of the NSDictionarys that belong in that sub-group.

This data is all static, though from time to time it will be updated by downloading a newer version of the data.

The user won't necessarily interact with this data every time they use the app, though the main 'group' will always be displayed during each use of the app.

So my question: what is the best way to store this data and then to load it when necessary? At first I was thinking of just putting it all in a plist and then creating an NSArray from this plist when the app opens, but I'm wondering if that will be slow. Since the user may not ever interact with this list, maybe an alternate approach is better?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

紙鸢 2024-12-25 07:56:58

尝试研究 SQLite 数据库结构。我认为对于像您正在使用的数据量较大的数据来说,这会快得多。网上有很多教程向您展示如何设置它并向您介绍它的各个部分。

Try looking into SQLite database structure. I think this will be much quicker for larger amounts of data like what you're using. There are plenty of tutorials online showing you how to set it up and introducing you to the various parts of it.

作妖 2024-12-25 07:56:58

另请查看非基于 SQL 的数据库,例如 Tokyo Cabinet。如果您不需要高级 SQL 查询,它们会更快并且需要更少的资源。

Also take a look at non-SQL-based databases like Tokyo Cabinet. If you don't need advanced SQL queries they are faster and require less resources.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文