0
我有關於EKEventEditViewController不會顯示導航欄中的「添加事件」標題這個奇怪的問題。我使用下面的代碼來呈現它:EKEventEditViewController默認導航欄標題不顯示
[eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
if (!granted) { return; }
__block EKEvent *calEvent = [EKEvent eventWithEventStore:eventStore];
calEvent.title = self.event.title;
calEvent.startDate = startDate;
calEvent.endDate = endDate;
calEvent.location = self.event.address.title;
[calEvent setCalendar:[eventStore defaultCalendarForNewEvents]];
__block EKEventEditViewController *eventViewController = [[EKEventEditViewController alloc] init];
eventViewController.editViewDelegate = self;
eventViewController.eventStore = eventStore;
eventViewController.event = calEvent;
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:eventViewController animated:YES completion:nil];
});
}];
結果是這樣的:
任何幫助將不勝感激。