我正在实现一个为我提供搜索查询结果的表视图。到目前为止,我能够使用SAX解析器解析响应,并获得一个字典对象数组。我需要在每次用户点击搜索时进行服务器调用。因此,不能选择将结果数组存储在数据库中。用于具有响应对象的数组较大的情况。以下是我能想到的两种方法:
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
考虑到我的本地数据库已经在处理其他操作,从内存和性能的角度来看,哪种方法更好?
发布于 2012-08-28 06:35:31
选项2是最好的选择。在这里,您可以将响应数据保存在字典中。您可以根据字典中的值重新装入该表。每次在数据库中保存数据都会减慢搜索过程,并增加不必要的开销。
https://stackoverflow.com/questions/12153406
复制相似问题