核心数据和分页 [英] core data and paging

查看:89
本文介绍了核心数据和分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个50,000个记录的数据库。我使用核心数据从搜索中提取记录。搜索可以轻松返回1000条记录。使用核心数据和uitableview对这些记录进行分页需要什么?我想一次显示100条记录,并在查看100条记录后显示加载更多按钮。

I have a database of 50,000 records. I'm using core data to fetch records from a search. A search could return 1000 records easily. What is needed to page through these records using core data and uitableview? I would like to show 100 records at a time and have 'load more' button after viewing 100 records.

推荐答案

在NSFetchRequest及其对批次的控制。您可以设置批量大小和偏移量,这将允许您浏览数据。

Take a look at the NSFetchRequest and its controls over batches. You can set the batch size and the offset which will allow you to "page" through the data.

这篇关于核心数据和分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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