initialize event in EKEventEditViewController

后端 未结 1 494
长发绾君心
长发绾君心 2021-02-10 18:05

My code is following

EKEventEditViewController *addController = [[EKEventEditViewController alloc] initWithNibName:nil bundle:nil];


// set the addController\'s         


        
1条回答
  •  时光取名叫无心
    2021-02-10 18:31

    I found a way.

    EKEventStore *eventStore = [[EKEventStore alloc] init];
    EKEvent *event  = [EKEvent eventWithEventStore:eventStore];
    event.startDate = event_date;
    event.endDate   = event_date;
    event.notes=event_note;
    
    
    EKEventEditViewController *addController = [[EKEventEditViewController alloc] initWithNibName:nil bundle:nil];
    
    
    // set the addController's event store to the current event store.
    addController.eventStore = eventStore;
    addController.event=event;
    
    // present EventsAddViewController as a modal view controller
    [parent presentModalViewController:addController animated:YES];
    
    addController.editViewDelegate = self;
    [addController release];
    

    0 讨论(0)
提交回复
热议问题