这个错误是什么意思(在事件修改时)?
大家好,我正在使用下面的代码创建一个事件:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的开始结束日期来自不同的年份。今年 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.