【问题标题】:How to add Events in iPhone calendar application using our iphone application.如何使用我们的 iphone 应用程序在 iPhone 日历应用程序中添加事件。
【发布时间】:2011-09-02 14:26:44
【问题描述】:

如何在 iPhone 日历中添加事件。我只想使用我的应用程序在 iPhone 日历中添加事件,并想为 perticuler 事件设置推送通知。请帮我解决这个问题。谢谢。

【问题讨论】:

标签: iphone xcode events icalendar


【解决方案1】:

要以编程方式创建事件,您将使用 EventKit,更具体地说,是提供的 EKEventEditViewController。请参阅 Apple 文档以获取 explanation and sample code

在 iOS 4.0+ 中,您还可以在不编写任何 EventKit 代码的情况下访问该控制器。为此,请使用配置了dataDetectorTypes = UIDataDetectorTypeCalendarEventUITextView。 UITextView 会自动将表示格式化日期、星期几等的字符串转换为处理事件创建的可点击 URL。

有关其他问题,请参阅 Apple iOS 文档。如果有任何特定的情况不适用于您的情况,请发布一些代码,向我们展示您已经尝试过的内容等。

【讨论】:

    【解决方案2】:

    您可以使用此代码

    EKEventStore *es = [[EKEventStore alloc] init];
    EKEventEditViewController *controller = [[EKEventEditViewController alloc] init];
    controller.eventStore = es;
    controller.editViewDelegate = self;
    
    [self presentModalViewController:controller animated:YES];
    [controller release];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-13
      • 2011-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-16
      相关资源
      最近更新 更多