0

predicateForEventsWithStartDate returns nil when the startDate and endDate are same even when there is an event for the dates I am providing, but the same function seems to work if the start and end date are different.

    var predicate:NSPredicate = eventStore.predicateForEventsWithStartDate(fromDate, endDate: toDate, calendars: [defaultCalendar as EKCalendar])       
    var events:[AnyObject]? = eventStore.eventsMatchingPredicate(predicate)

events is nil. I have also checked eventStore is not nil. Thanks for the help

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
sahiljain
  • 2,215
  • 1
  • 29
  • 39

1 Answers1

0

I resolved it, My defaultCalendar was nil, I then assigned this with all the calendar array

sahiljain
  • 2,215
  • 1
  • 29
  • 39