I know that there already are lots of questions and even useful answers concerning this question on the web. I tried to add a calendar event to the iPhone calendar from inside my application. I used this code, which actually worked:
EKEventStore *es = [[EKEventStore alloc] init];
EKEventEditViewController *controller = [[EKEventEditViewController alloc] init];
controller.eventStore = es;
controller.editViewDelegate = self;
[self presentModalViewController:controller animated:YES];
The only thing was that I could not release the calendar controller, which is because I should have said:
[Controller release]
or something But my main.m is set to autorelease:
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([...AppDelegate class]));
}
}
and if I manually release I get an error, do I have to change something in the main.m?