填写Tableview的更好方法

时间:2012-08-28 05:46:07

标签: objective-c ios uitableview core-data nsmutablearray

我正在实现一个tableview,它为搜索查询提供结果。到目前为止,我能够使用SAX解析器解析响应并获取字典对象数组。每次用户点击搜索时我都需要拨打服务器电话。因此,将结果数组存储在数据库中不是一种选择。对于具有响应对象的Array很大的情况。以下是我能想到的两种方法:

1. I should save each result (dictionary object) while parsing in local database and then   load the tableview when the request completes.

2. Load the tableview using the array of dictionary objects after the request completes

鉴于我的本地数据库已经处理了其他操作,从内存和性能的角度来看哪种方法更好?

1 个答案:

答案 0 :(得分:0)

选项编号。 2是最好的方式。在这里,您可以将响应数据保存在字典中。您可以根据字典中的值重新加载表。每次在数据库中保存数据都会降低搜索过程的速度并增加不必要的开销。