这个错误是什么意思(在事件修改时)?

发布于 2024-09-14 07:32:37 字数 1677 浏览 3 评论 0原文

大家好,我正在使用下面的代码创建一个事件:

EKEvent *oneLabEvent = [EKEvent eventWithEventStore:eventStore];

oneLabEvent.calendar = eventStore.defaultCalendarForNewEvents;
oneLabEvent.title = [ddEvent valueForKey:@"ddname"];
oneLabEvent.allDay = NO;

oneLabEvent.startDate = [ddEvent valueForKey:@"startDate"];
oneLabEvent.endDate = [ddEvent valueForKey:@"endDate"];


//setting the alarm for the event

EKAlarm * alarm = [EKAlarm alarmWithRelativeOffset:0];
oneLabEvent.alarms = [NSArray arrayWithObject:alarm];

//setting the Reuccurence rule
EKRecurrenceRule * recurrenceRule = [[EKRecurrenceRule alloc] 
                                     initRecurrenceWithFrequency:EKRecurrenceFrequencyMonthly
                                     interval:1
                                     end:nil];
if (oneLabEvent.endDate != nil) {
    EKRecurrenceEnd * end = [EKRecurrenceEnd recurrenceEndWithEndDate:oneLabEvent.endDate];
    recurrenceRule.recurrenceEnd = end;
}else {
    oneLabEvent.endDate = oneLabEvent.startDate;
}



oneLabEvent.recurrenceRule = recurrenceRule;
[recurrenceRule release];

NSError *error;

BOOL saved = [eventStore saveEvent:oneLabEvent span:EKSpanThisEvent error:&error];
if (!saved && error) {
    NSLog(@"Error while saving the event:%@",[error localizedDescription]);
}

[ddEvent setValue:oneLabEvent.eventIdentifier forKey:@"eventID"];

在我的手机中,它的工作原理就像一个魅力,但是当朋友在他的 iPhone 中尝试修改事件时,他会收到此错误。

替代文本 http://img208.imageshack.us/img208/8850/photot.png< /a>

现在谁能告诉我我的代码有什么问题或者是否有任何日历设置可能与我的手机和朋友的手机不同。

Hi all I am using below code to create an event :

EKEvent *oneLabEvent = [EKEvent eventWithEventStore:eventStore];

oneLabEvent.calendar = eventStore.defaultCalendarForNewEvents;
oneLabEvent.title = [ddEvent valueForKey:@"ddname"];
oneLabEvent.allDay = NO;

oneLabEvent.startDate = [ddEvent valueForKey:@"startDate"];
oneLabEvent.endDate = [ddEvent valueForKey:@"endDate"];


//setting the alarm for the event

EKAlarm * alarm = [EKAlarm alarmWithRelativeOffset:0];
oneLabEvent.alarms = [NSArray arrayWithObject:alarm];

//setting the Reuccurence rule
EKRecurrenceRule * recurrenceRule = [[EKRecurrenceRule alloc] 
                                     initRecurrenceWithFrequency:EKRecurrenceFrequencyMonthly
                                     interval:1
                                     end:nil];
if (oneLabEvent.endDate != nil) {
    EKRecurrenceEnd * end = [EKRecurrenceEnd recurrenceEndWithEndDate:oneLabEvent.endDate];
    recurrenceRule.recurrenceEnd = end;
}else {
    oneLabEvent.endDate = oneLabEvent.startDate;
}



oneLabEvent.recurrenceRule = recurrenceRule;
[recurrenceRule release];

NSError *error;

BOOL saved = [eventStore saveEvent:oneLabEvent span:EKSpanThisEvent error:&error];
if (!saved && error) {
    NSLog(@"Error while saving the event:%@",[error localizedDescription]);
}

[ddEvent setValue:oneLabEvent.eventIdentifier forKey:@"eventID"];

in my phone it works like a charm but when a friend in his iphone tries modifications to the event He gets this error .

alt text http://img208.imageshack.us/img208/8850/photot.png

Now can anyone tell me that is anything wrong with my code or is there any calendar settings that can be different from my phone and friend phone .

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

伴梦长久 2024-09-21 07:32:37

您的开始结束日期来自不同的年份。今年 8 月 14 日是星期六,但您的结束日期显示为 8 月 14 日星期五

所以它来自另一年,使其长于一个月,这是您的重复间隔。

Your start end end dates are from different years. 14th August is a Saturday this year, but your end date shows Moday for 14th August.

So it is from another year, making it longer than one month, which is your repeat interval.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文