English 中文(简体)
更新可读书库数据库
原标题:Calling SQLite database to update UITableView

I ve been asking lately about Obj-C circular buffer objects, assuming that would be the better way to control tons of data on a UITableView.
I have found a solution as far as Circular buffer objects go, but I ve been wondering about maybe a better, faster and much more memory efficient solution: Calling my SQLite DB to update the UITableView.
In a way - the memory will be released after updating the UITableView, and there won t be any need to hold reference to the objects, which will be more efficient and memory saving than holding a constant NSMutableArray with all of the objects inside it.

您将如何更新可检索的数据集(50千件物体),这些数据也储存在Kingk数据库中?

Thanks in advance, ~ Natanavra.

问题回答

What you are describing is exactly what NSFetchedResultsController was designed for, and is one of the huge advantages of using Core Data on the iPhone. With NSFetchedResultsController, you can set up a fetch request from your database for the elements to be displayed in your table view, and limit the batch size of items to be loaded at any given time. This significantly reduces memory consumption and loading time (I ve seen 8X improvements in loading time in specific examples).

NSFetRestorsController被设计成可调用的电文。 关于具体事例,我查阅了 Apple果样本代码,例如http://developer.apple.com/iphone/library/samplecode/CoreDataBooks/index.html#/apple_ref/doc/uid/DTS40008405” rel=“nofollow noreferer>,以及Zarras的适当章节:。 这两本书都很好地解释了核心概念。





相关问题
sqlite3 is chopping/cutting/truncating my text columns

I have values being cut off and would like to display the full values. Sqlite3 -column -header locations.dbs " select n.namelist, f.state, t.state from names n left join locations l on l.id = n.id ...

Entity Framework with File-Based Database

I am in the process of developing a desktop application that needs a database. The application is currently targeted to SQL Express 2005 and works wonderfully. However, I m not crazy about having ...

Improve INSERT-per-second performance of SQLite

Optimizing SQLite is tricky. Bulk-insert performance of a C application can vary from 85 inserts per second to over 96,000 inserts per second! Background: We are using SQLite as part of a desktop ...

Metadata for columns in SQLite v2.8 (PHP5)

How can I get metadata / constraints (primary key and "null allowed" in particular) for each column in a SQLite v2.8 table using PHP5 (like mysql_fetch_field for MySql)? sqlite_fetch_column_types (OO:...

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签