1

我正在尝试打开 EKEventStore 以在应用程序中设置提醒。使用以下代码成功打开它

EKEventEditViewController *addController = [[EKEventEditViewController alloc] init];
addController.eventStore = self.eventStore;
addController.editViewDelegate = self;
[self presentViewController:addController animated:YES completion:nil];

但是当我尝试以编程方式添加 EKEvent 标题时,它不会出现在日历中。

For adding title code is 

EKEvent *addEvent = [EKEvent eventWithEventStore:self.eventStore];
addEvent.title = [NSString stringWithFormat:@"%@", textcontainer.text];

EKReminder *reminder = [EKReminder reminderWithEventStore:eventStore];
reminder.location=@"Ludhiana";

但它不工作。难道我做错了什么?请帮帮我。

提前致谢。

4

1 回答 1

1

感谢@satheeshwaran 查看我的查询。但我已经通过以下方式解决了这个问题:

EKEvent *addEvent = [EKEvent eventWithEventStore:self.eventStore];
addEvent.title=[NSString stringWithFormat:@"%@", textcontainer.text];
EKEventEditViewController *addController = [[EKEventEditViewController alloc] init];
addController.eventStore = self.eventStore;
addController.event=addEvent;
addController.editViewDelegate = self;
[self presentViewController:addController animated:YES completion:nil];
于 2013-10-11T06:37:28.990 回答