EKEventStore getting events returns empty list

浪尽此生 提交于 2019-12-04 23:42:25

I agree with James pulling too many events in with a date that is so far in the future is not advised, luckily you can use distantFuture to pull in, well distant events.

This obviously does not pull all events but as many events as it can in with out causing memory or other issues.

NSDate *endDate = [NSDate distantFuture];

Hope that helps

It's generally a bad thing to query for such a large date range of events from CalendarStore. Performance is horrible pulling a month at a time, and you're wanting to pull "all"? Definitely not advised. Let CalendarStore be the one that has to worry about 'all', and you should focus on how to properly scope the date ranges you need to pull.

For instance, if you have a normal calendar app showing a month at a time, just pull down 3 months (your target month, plus the month in front and back of your current calendar). If someone pages to the next month, then put a request out to get the month after that, and so on.

Maybe you could provide more info on what's driving your desire to get 'all' events?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!