Note that there are some explanatory texts on larger screens.

plurals
  1. POSpeed up fetch of EKEvents
    primarykey
    data
    text
    <p>in my app I'm displaying a list of EKEvents and I would like to display all events of a month in a UITableView, each section containing the respective days. Well, this works and I get all the data, I need, but the fetch is very slow.</p> <p>The problem consists in events, which spread across multiple days.</p> <ul> <li>Let's say I'm going on vacation from 10th of November until 17th of November.</li> <li>My search predicate has a startDate with 1st of November and an endDate with 30th of November.</li> <li>I do an enumerateEventsMatchingPredicate or eventsMatchingPredicate, whatever, both are slow.</li> </ul> <p>I get an array in return with all events taking place in November, as well as my vacation. But my vacation is just one EKEvent object. So if I want to display a monthly list view of events it would only appear once, on 10th of November, but for reasons of clarity I would to show it on every day it takes place, 10th, 11th, ... 17th.</p> <p>So what I do is, iterate over each day in a month and do a fetch :-/ This way I get the correct amount of events that take place on a specific day, but ... it feels so complicated.</p> <p>I already put the fetch into a dispatch_async, so the fetch doesn't block the UI and after the fetch is finished the tableView gets reloaded and cells redrawn. But it still takes time. No userfriendly time.</p> <p>How do you perform those searches? Do you have any tips on how to speed up the search, maybe a little code snippet or can point me in the right direction!?</p> <p>Is my question clear? :-/</p> <p>Thanks, -Martin.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload