EKEventViewDelegate didCompleteWithAction没有被调用

Rob*_*Rob 5 iphone eventkit

我没有调用我的eventViewController:didCompleteWithAction:当EKEventViewController完成编辑事件时.

这是我如何设置它:


- (void)showCalendar:(id)sender {
    EKEventViewController *eventViewController = [[EKEventViewController alloc] init];

    eventViewController.delegate = self;

    eventViewController.event = self.event;

    // Allow event editing.
    eventViewController.allowsEditing = YES;

    [self.navigationController pushViewController:eventViewController animated:YES];
    [eventViewController release];
}
Run Code Online (Sandbox Code Playgroud)

我的课上有协议,方法是通过复制和粘贴文档中的定义来实现的.它只是没有被调用.

如果我使用EKEventEditViewController及其相应的委托,那么在保存事件时会调用它.

我能够在SimpleEKDemo代码中重现该问题.有谁知道什么可能是错的?

我可以放弃视图功能并直接进入EKEventEditViewController,但我宁愿不这样做.

小智 1

在此 .m 文件中,您需要导入 EventKit/EventKit.h 和 EventKitUI/EventKitUI.h,在 .h 文件中,您需要实现“EKEventViewDelegate”委托。

希望对你有帮助