gpt4 book ai didi

ios - 错误域=EKCADErrorDomain 代码=1013 "The operation couldn’ t 完成。 (EKCADErrorDomain 错误 1013。)”

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:12:15 24 4
gpt4 key购买 nike

<分区>

EKReminder *reminder = [EKReminder reminderWithEventStore:self.eventStore];
reminder.title = @"E-Cold 1mg";
reminder.calendar = [_eventStore defaultCalendarForNewReminders];
NSDate *date = [_myDatePicker date];

// get today date
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; // here we create NSDateFormatter object for change the Format of date..
[dateFormatter setDateFormat:@"YYY-MM-dd"]; //Here we can set th

NSLog(@"%@",[dateFormatter stringFromDate:date]);
EKAlarm *alarm = [EKAlarm alarmWithAbsoluteDate:date];

[reminder addAlarm:alarm];

//EKRecurrenceFrequency频率;

NSError *error = nil;

[_eventStore saveReminder:reminder commit:YES error:&error];

if (error)
{
NSLog(@"error = %@", error);
}`

上面的代码设置为闹钟很好但是当我重置模拟器时调用此方法显示此错误错误获取新提醒的默认日历:

Error Domain=EKCADErrorDomain Code=1013 "The operation couldn’t be completed. (EKCADErrorDomain error 1013.)"
error = Error Domain=EKErrorDomain Code=1 "No calendar has been set." UserInfo=0x7f8fca4eac80 {NSLocalizedDescription=No calendar has been set.}

然后再次停止并构建运行良好的应用程序。为什么第一次启动时会出现此错误

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com