Search code examples
objective-cioscocoa-toucheventkit

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

  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]];

Solution

  • You should assign event object to controller.

    controller.event = event;