简体   繁体   English

使用EK事件,EventKit未显示事件标题

[英]Event Title Not Showing Using EK Events, EventKit

A the title suggests when presenting the view for an event using EventKit my title string does not show in the presented view, its just blank 标题提示使用EventKit呈现事件视图时,标题字符串未显示在呈现的视图中,只是空白

  EKEventStore *es = [[EKEventStore alloc] init];
                EKEventEditViewController *controller = [[EKEventEditViewController alloc] init];
                controller.eventStore = es;
                controller.editViewDelegate = self;

                EKEvent *event  = [EKEvent eventWithEventStore:eventStore];
                event.title = @"This is an event"; //does not appear in presented view

               [self.editController presentModalViewController:controller animated:YES];

               [event setCalendar:[eventStore defaultCalendarForNewEvents]];

您应该将事件对象分配给控制器。

controller.event = event;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM