I’m using the following code:
//create instance of EKEventStore
EKEventStore *eventStore = [[EKEventStore alloc] init];
//creating instance of EKEvent
EKEvent *event = [EKEvent eventWithEventStore:eventStore];
//setting the appropriate properties of the new event
event.title = @"England";
event.startDate = [[NSDate alloc] init];
event.endDate = [[NSDate alloc] initWithTimeInterval:600
sinceDate:event.startDate];
event.location = @"Metalist";
event.notes = @" Play";
[event setCalendar:[eventStore defaultCalendarForNewEvents]];
NSError *error;
[eventStore saveEvent:event span:EKSpanThisEvent error:&error];
i want to save this data in:
9 june 2012 – 18:00 hour how can i do this?
event.startDate = [[NSDate alloc] init];
event.endDate = [[NSDate alloc] initWithTimeInterval:600 sinceDate:event.startDate];
And i want to make a warning (alert) too
To create an
NSDateobject with a specific date, you can use theNSDateComponentsclass:Don’t forget to release
myDateif you are not using ARC: