活动套件日历中的商店活动将更改时区问题

时间:2013-06-28 05:56:24

标签: ios eventkit ekevent

+(NSString *)setCalendarEvent:(NSString *)title withStartDate:(NSDate *)startDate withEndDate:(NSDate *)endDate withAlarmBefore:(NSTimeInterval )alarmTime{




     EKEventStore *eventStore = [[EKEventStore alloc] init];

        EKEvent *event  = [EKEvent eventWithEventStore:eventStore];
        event.title     = title;
        event.startDate = startDate;
        event.endDate   = endDate;

        NSMutableArray *myAlarmsArray = [[NSMutableArray alloc] init];
        EKAlarm *alarm1 = [EKAlarm alarmWithRelativeOffset:-alarmTime];
        [myAlarmsArray addObject:alarm1];
        event.alarms = myAlarmsArray;

        [event setCalendar:[eventStore defaultCalendarForNewEvents]];
        NSError *err;

        [eventStore saveEvent:event span:EKSpanThisEvent error:&err];
        NSString* eventId = [[NSString alloc] initWithFormat:@"%@", event.eventIdentifier];
        return eventId;

}

每当我将日期存储在日历中时,它都不会存储实际日期。

我想存储来自 CMS的确切日期如何通过更改时区来阻止 iOS 日历。

0 个答案:

没有答案