1

I just came across a bug in my program, that has me confused. I add several events to the iPhone calendar in my app. I found that when I receive a "No end date has been set." error when calling saveEvent:span:error:, all subsequent calls to saveEvent:span:error: result in the same error message. If I change the culprit object to be valid, all events save successfully. Has anybody ran into this? Or do you know why one error might cause all future calls to result in the same error?

I know that I just need to not save an event with no end date set to fix this, but I would like to know why this is happening.

Thanks.

Ryan
  • 518
  • 3
  • 12

1 Answers1

1

I figured this out. There is a bug in the EKEvent SDK on iOS 5 that is causing this. Hopefully it will be fixed in the first update to iOS 5. Solution:startDate and endDate should be different.

[event setStartDate:date]; [event setEndDate:[date dateByAddingTimeInterval:1.0]];

Community
  • 1
  • 1
Ryan
  • 518
  • 3
  • 12
  • Has this been fixed in iOS 5.0.1? I have a similar issue with the native app, sometime I can't save or cancel when creating an event. But I can't seem to fine the root cause or how to reproduce it. – Loïc Wolff Jan 09 '12 at 13:41
  • I'm not sure, I haven't checked yet. You could let me know though. :) – Ryan Jan 10 '12 at 16:57
  • I'm not an Obj-C dev, I've just had some trouble with the Calendar app on iOS where it wouldn't let me `Save` or `Cancel`. I have to kill the app. But since I can't reproduce every time, I thought that the issue you're facing might be the culprit. If you're still having this issue, that would have helped me to narrow the issue – Loïc Wolff Jan 10 '12 at 17:01