EKRecurrenceRule with end repeat never

…衆ロ難τιáo~ 提交于 2019-12-21 23:07:10

问题


I want to create a EKEvent in calendar with forever repeat option. Below is the code for the Recurrence rule

  EKRecurrenceRule *rule = [[EKRecurrenceRule alloc] 
                            initRecurrenceWithFrequency:EKRecurrenceFrequencyDaily 
                            interval:1
                            end:[EKRecurrenceEnd recurrenceEndWithEndDate:date]];

how to set infinite or never end in recurrence end argument.

Thanks


回答1:


little late, but i 'll answer, because i could not find the answer anywhere in the Apple Doc. Just pass nil as end param and there you go. Calender sets the end of the event to infinite.

EKRecurrenceRule *rule = [[EKRecurrenceRule alloc] 
                        initRecurrenceWithFrequency:EKRecurrenceFrequencyDaily 
                        interval:1
                        end:[EKRecurrenceEnd recurrenceEndWithEndDate:nil]];

The calender creates recurrence events for 2 years and then adds them on demand.

greets




回答2:


EKRecurrenceRule *rule = [[EKRecurrenceRule alloc] 
                        initRecurrenceWithFrequency:EKRecurrenceFrequencyDaily 
                        interval:1
                        end:nil];

just pass nil to the end so that it repeats all over. Have a happy Coding.



来源:https://stackoverflow.com/questions/7951977/ekrecurrencerule-with-end-repeat-never

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