【问题标题】:Why doesn't my iPhone's iCal display calendars that I create in the local source?为什么我的 iPhone 的 iCal 不显示我在本地源中创建的日历?
【发布时间】:2012-07-17 16:26:32
【问题描述】:

这是我用来创建名为 BART 的本地日历的方法:

- (void)createCalendar
{
    [self setEventStore: [[EKEventStore alloc] init]];

    EKSource *local = nil;

    for (EKSource *source in eventStore.sources){
        if (source.sourceType == EKSourceTypeLocal){
            local = source;
            break;
        }
    }

    NSSet *cals = [local calendars];
    NSLog(@"%@\n",cals);

    [self setBart: [EKCalendar calendarWithEventStore: eventStore]];
    bart.source = local;
    bart.title = @"BART";
    [eventStore saveCalendar:bart commit:YES error:nil];

}

当我在 iPhone 上测试运行程序时,日历没有出现在我的 iCal 中,但我在 Xcode 中的输出窗口显示存在本地源并且它包含我创建的日历。如何让 iCal 显示日历?

【问题讨论】:

  • 您想使用内置的“日历应用”显示日历吗?
  • 是的,我想使用内置的“日历应用程序”显示日历。 @BlackFrog

标签: iphone xcode4 icalendar


【解决方案1】:

iOS 事件工具包(日历 API)允许应用访问用户日历数据库中的事件信息。

如果您想在应用中显示这些事件,则必须创建自己的 UIView。

要使用内置的“日历应用”显示活动,用户必须选择自己查看日历。您无法从您的应用中启动它。

看看以下内容: Does iOS Calendar support a URL scheme? Is there an iPhone URL shortcut for calendar?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多