HI Everything
I currently have an NSFetchedResultsController setting that returns all rows in a table in my main database. Then it fills my UITableView. The trouble is that it will quickly get out of hand when the rows grow in quantity.
How can I limit the original query to say 20 results and then add a button somewhere in the “Get More” button, where are we from?
Thanks for any guidance, as always.
NSFetchRequest - setFetchLimit: - setFetchOffSet.
, NSFetchedResultsController , NSFetchedResultsController. , , ( w/new fetch request) , , /.
Apple bugreporter.apple.com, , .
, :
fetchRequest NSFetchedResultsController, , , , .
:
[yourFetchedResultsController.fetchRequest setFetchLimit:50]; [NSFetchedResultsController deleteCacheWithName:"you cache name"]; [yourFetchedResultsController performFetch:nil];
fetchBatchSize , . , . batchSize, fetchLimit offset, "", .
, , - NSFetchedResultsController, , . , .
I believe that instead of setting -setFetchLimit and restricting your NSFetchRequest (for new lines you need to create a new reqeust), set -fetchBatchSize to control only the number of lines that are loaded into memory. Say: if you show 10 cells per view, set the batch size to double or so. As you scroll through your view, the controller will automatically load the new set into memory.
Source: https://habr.com/ru/post/1762346/More articles:Лучшая инструментальная цель для разработки Flash (ActionScript 3)? - flashEncryption and integrity of database connection using ColdFusion and Oracle thin client - javaLeft Outer Join subqueries? - sqlПроблема Intelligencia.UrlRewriter с состоянием сеанса - asp.netCreating an Infinite Silverlight ItemsControl Control - data-bindingWhat are the units of UDP buffers and where are the docs for sysctl parameters? - linuxIs it possible to have html code and all images in one file? - htmlВозможно ли, чтобы шаблон Django тестировал существование строки в таблице без написания специального тега/фильтра? - djangoHow to prepare for Java evaluation from the point of view of a C # programmer? - javaUpgrading to the final Oracle JDBC driver results in a SQLException: Unexpected exception while invoking XAConnection - javaAll Articles