I added the framework EventKit and I have this code. I can't add an event at default calendar.
#import "Calendar.h"
#import <EventKit/EventKit.h>
@implementation Calendar
-(IBAction)addCal:(id)sender
{
EKEventStore *store = [[EKEventStore alloc] initWithAccessToEntityTypes:EKEntityMaskEvent];
EKEvent *evento = [EKEvent eventWithEventStore:store];
[evento setStartDate:[NSDate date]];
[evento setTitle:@"Title"];
[evento setCalendar:[store defaultCalendarForNewEvents]];
NSError *error;
[store saveEvent:evento span:EKSpanThisEvent commit:YES error:&error];
}
In Console I have this: "We are including and fetching events, because this application did something event-related. If this application doesn't care about events, then this is a potentially expensive call."
I'm a beginner. Thanks for your help.