开发者

What does this error mean (while event modification)?

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 .


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜