Availability of iPhone EKEvent, I'm trying to install it, but it will not change

I am trying to establish the availability of an event that I am importing into the iphone calendar with my application. I am using this code:

[event1 setAvailability:EKEventAvailabilityFree];

When I sync my iphone with iCal, I check for an event and it says “Busy”. Xcode asks for an integer, but not for the free option. I am not getting errors when I run this code, maybe someone can help figure out what happened.

+3
source share
3 answers

, , . , , ( ).

:

EKEvent *event = [EKEvent eventWithEventStore:eventStore];
event.title = subject;
event.calendar = [eventStore defaultCalendarForNewEvents];
if (event.availability != EKEventAvailabilityNotSupported) {
    event.availability = EKEventAvailabilityFree;
}
+8

, , . .

.

event.calendar = //calendar object
event.availability = //availability typedef
+2

Did you save the event in the event store that contains it? See the post saveEvent:span:error:in the reference to the EKEventStore class .

0
source

Source: https://habr.com/ru/post/1770127/


All Articles