Tag Archives: enddate

Error adding EKEvent on iOS 5

If you try to add an EKEvent with startDate equals to endDate to EKEventStore on iOS5, it will throw an error like “No end date has been set”.
To get rid of this problem, you should add a second to endDate property, something like:

if ([event.endDate isEqualToDate:event.startDate]) {
    event.endDate = [event.startDate dateByAddingTimeInterval:1.0]; // add one second

Source: stack overflow