在iOS4中预填存储的数据 [英] Prepopulated stored data in iOS4

查看:106
本文介绍了在iOS4中预填存储的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用iPhone iOS 4.3。

I work with iPhone iOS 4.3.

在我的项目中,我需要一个只读,重新填充的数据表(例如一个20行20字段的表) 。

In my project I need a read-only, repopulated table of data (say a table with 20 rows and 20 fields).

这些数据必须通过行上的键获取。

This data has to be fetched by key on the row.

什么是更好的方法? CoreData存档,SQLite或其他?

What is better approach? CoreData Archives, SQLite, or other? And how can I prepare and store this table?

推荐答案

最简单的方法是使用NSDictionary对象的NSArray,然后将数组作为plist保存到磁盘。将plist包含在构建中,然后在运行时将其从应用程序包中读取。

The simplest approach would be to use an NSArray of NSDictionary objects and then save the array to disk as a plist. Include the plist in your build and then open it read only from the app bundle at runtime.

每个行都将是返回字典对象的数组的元素索引,其中每个列都是键值对。

Each "row" would be the element index of the array which would return a dictionary object wherein each "column" would be a key-value pair.

这篇关于在iOS4中预填存储的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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