EKEventStore.calendars返回不存在的"calendar"消息.目的 [英] EKEventStore.calendars returns non-existing "calendar" object

查看:64
本文介绍了EKEventStore.calendars返回不存在的"calendar"消息.目的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用来获取IOS5上的所有日历时

When obtaining all calendars on IOS5 using

EKEventStore *eventStore = [[EKEventStore alloc] init];
NSArray * calendars = [eventStore calendars];

返回了一个名为"calendar"的日历.该日历在用户日历列表中不存在.它具有以下属性:

there is a calendar named "calendar" returned. This calendar is not existing in users calendar list. It's holding this properties:

EKCalendar <0x357700> {title = Calendar; type = Local; allowsModify = YES; color = #882F00;

用户可以在其中存储事件.这些事件显示在IOS日历上.有人知道这是哪种日历吗?似乎是某种默认日历.顺便说一句:用户日历都是基于CalDAV的,因此这可能是导致该对象的原因.

User can store events there. Those events are displayed on the IOS calendar. Does anyone know what kind of calendar this is? Seems to be some sort of default calendar. BTW: Users calendars are all CalDAV based, so this might be the reason for this object.

推荐答案

在代码中,您无法完全访问用户在其本机应用程序中拥有的所有日历.

In code you don't have complete access to all the calendars the user has in its native app.

"Event Kit provides limited access to a user’s calendar information. It is not
suitable for implementing a full-featured calendar application."

如果您要编辑现有活动,则不会有任何问题:

If you want to edit an existing event, you'll have no problems:

 "You can fetch events based on a date range or a unique identifier,
receive notifications when event records change, and allow users to create
and edit events for any of their calendars. Changes made to events in a
user’s Calendar database with Event Kit are automatically synced with the
appropriate calendar (CalDAV, Exchange, and so on)."

如果您要添加新事件,则只能将其添加到该用户已选择为默认日历的日历中(在设置应用程序中).

If you want to add new event, you can only add it to the calendar, that user had selected as the default calendar (in settings application).

    "Creating and Editing Events

    If the event property is nil when you present the view controller,
the user creates a new event in the default calendar and saves it to
the specified event store.

    If the event property is nil when you present the view controller,
the user creates a new event in the default calendar and saves it to
the specified event store."

《事件工具包编程指南》 .

这篇关于EKEventStore.calendars返回不存在的"calendar"消息.目的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆