Error loading default properties for x-apple-eventkit object

Help create and save events on the Icloud calendar. After saving, I have an error:

Error loading default properties for object x-apple-eventkit:///Alarm/p252 from daemon: Error Domain=EKCADErrorDomain Code=1010 "(null)"



Error loading to-one relation originalAlarm from daemon: Error Domain=EKCADErrorDomain Code=1010 "(null)"

My code is:

    NSDateFormatter *dateFromater = [[NSDateFormatter alloc]init];
NSTimeZone * timeZone = [NSTimeZone localTimeZone];
[dateFromater setTimeZone:timeZone];
[dateFromater setDateFormat:@"Y-MM-d'T'HH:mm:ss'.000Z'"];
EKEventStore* evStore = [[EKEventStore alloc]init];
[evStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError * _Nullable error) {

    EKEvent * event = [EKEvent eventWithEventStore:evStore];


    event.location=[dictionry valueForKey:@"location"];
    event.title = [dictionry valueForKey:@"eventName"];
    event.notes = [dictionry valueForKey:@"description"];

    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"];
    NSString *str = [formatter stringFromDate:[NSDate date]];


    event.startDate = [formatter dateFromString:[dictionry valueForKey:@"eventDate"]]; //[dictionry valueForKey:@"eventDate"];
    event.endDate = [event.startDate dateByAddingTimeInterval:60];

    EKAlarm *ekAlarm = [EKAlarm alarmWithRelativeOffset:-60];
    [event addAlarm:ekAlarm];

    RLMResults *object = [RealmUser allObjects];
    self.user= [object firstObject];
    event.calendar = [evStore calendarWithIdentifier:self.user.calendarIdentifier];

    EKRecurrenceEnd * end = [EKRecurrenceEnd recurrenceEndWithEndDate:[NSDate dateWithTimeIntervalSince1970:[[dictionry objectForKey:@"endDateForReps"]intValue]]];
    EKRecurrenceFrequency  freq;
    NSString    *timeUntilForReps =[dictionry objectForKey:@"timeUnitForReps"] ;

    if ([timeUntilForReps isEqualToString:@"week"]) freq = EKRecurrenceFrequencyWeekly;
    else if ([timeUntilForReps isEqualToString:@"day"]) freq = EKRecurrenceFrequencyDaily;
    else if ([timeUntilForReps isEqualToString:@"year"]) freq = EKRecurrenceFrequencyYearly;
    else if ([timeUntilForReps isEqualToString:@"mounth"]) freq = EKRecurrenceFrequencyMonthly;

    NSInteger timeInterval = [[dictionry valueForKey:@"repeatInterval"] integerValue];
    EKRecurrenceRule * rule = [[EKRecurrenceRule alloc]initRecurrenceWithFrequency:freq interval:timeInterval end:end];
    [event setRecurrenceRules:@[rule]];


    [evStore saveEvent:event span:EKSpanThisEvent commit:YES error:&error];
    if (error) NSLog(@"error");

}];
+4
source share
1 answer

I had this set of errors when reading calendar events:

Error loading default properties for object x-apple-eventkit:///Location/p1 from daemon: Error Domain=EKCADErrorDomain Code=1013 "(null)"
Error loading string title from daemon: Error Domain=EKCADErrorDomain Code=1013 "(null)"
Error loading default properties for object x-apple-eventkit:///Location/p1 from daemon: Error Domain=EKCADErrorDomain Code=1013 "(null)"
Error loading string address from daemon: Error Domain=EKCADErrorDomain Code=1013 "(null)"

Using NSLog, I determined that messages occurred while processing one specific event.

Based on the messages, I decided to record the location value of the event and compare it with other returned events. However, the value was an empty string, and all other events also had empty strings.

, , - ( x, , , ). (), x: !

, . . , .

  • , .

  • , .

  • .

0

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


All Articles