使用 iPhone 应用程序传送静态数据
我正在制作一款游戏,我需要能够发送一些有关游戏中各种船只的数据以及应用程序将使用的有关它们的详细信息。我正在寻找实现此目的的理想方法。现在我已将范围缩小到使用 SQLite、Core Data 或 Property Lists。现在我想记住的也是记忆。因为这是一个游戏,所以我需要小心这一点,而且由于属性列表需要全部加载到内存中,我担心它们可能并不理想。我知道 SQLite 应该具有比这更好的性能,而且我听说 Core Data 的性能甚至比这更好。所以我的问题是,您认为使用 iPhone 应用程序传输静态数据的最佳方式是什么?
I'm making a game and I need to be able to ship some data about the game's various ships and details about them that the app will use. I'm looking for what the ideal way to do this would be. Now I've narrowed it down to using either SQLite, Core Data, or Property Lists. Now the thing I want to keep in mind as well is memory. Because it's a game I need to be careful about this and because of the fact Property Lists need to be loaded all into memory I'm afraid they might not be ideal. I know SQLite is supposed to have better performance than that and I've heard that Core Data performs even better than that. So my question is what do you think the best way to ship static data with an iPhone app is?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想说这取决于您需要提供的数据量。如果数据量很大,我肯定会选择 sqlite。如果只是几艘船,sqlite 可能有点过头了。
I would say it depends on the amount of data that you need to provide. If it is a lot of a data, I would definitely go for sqlite. If it is just a couple of ships, sqlite might be a little over the top.
对于如此少量的数据,为什么不考虑编写自己的文件格式,或者使用易于解析的文件格式(例如 csv),这样可以轻松在任何电子表格程序中进行编辑,并减少文件大小/加载时间,将其转换为二进制格式。
For a such a small amount of data why dont you consider writing your own file format, or using something easy to parse such as csv, will be easy to edit in any spreadsheet program, and to cut down filesize / load times convert it into a binary format.
假设并非同时需要所有船舶数据(因此,将它们全部放在一个文件中将是一种浪费):也许您应该为每艘船或每一类船舶使用单独的数据文件?
由于这将解决不同级别的存储效率,因此 plist 可能是一个可行的选择。
Assuming that not all ship-data is needed at the same time (and as such, having them all in one file would be a waste): Maybe you should use a separate data file for each ship or each class of ships?
Since this would solve the storage-efficiency at a different level, plists might be a viable option.