在EventKit中将EKParticipants添加到EKEvent [英] Adding EKParticipants to an EKEvent in EventKit

查看:147
本文介绍了在EventKit中将EKParticipants添加到EKEvent的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以编程方式将参与者添加到iPhone上的EKEvent。

I'd like to programatically add a participant to an EKEvent on the iPhone.

EKParticipant的类引用声明您不直接创建EKParticipant对象。发送与会者到一个EKEvent对象,用于获取EKParticipant对象数组。。

EKParticipant's class reference states "You do not create EKParticipant objects directly. Send attendees to an EKEvent object to get an array of EKParticipant objects.".

EKEvent的类引用表明'与会者'成员(NSArray)是与该事件关联的与会者,作为EKParticipant对象的数组。(只读)

EKEvent's class reference states that the 'attendees' member (NSArray) is "The attendees associated with the event, as an array of EKParticipant objects. (read-only)"

看起来像鸡蛋和鸡蛋的场景 - 如何将参与者发送给EKEvent对象,如果与会者a。)是只读的,而b。)包含无法直接创建的对象?

Seems like a chicken-and-egg scenario - how does one "Send attendees to an EKEvent object", if the attendees member a.) is read-only and b.) contains objects that cannot be directly created?

推荐答案

如果你想要将参与者添加到EKEvent,您必须实现EKEventKitUI,并使用该框架的视图控制器,此框架提供日历本机视图,以便您可以为您的EKEvent添加参与者。

If you want to add attendees to an EKEvent, you must implement EKEventKitUI, and use the view controllers of that framework, this framework provide the calendar native like views so you can add attendees for your EKEvent.

但您无法将与会者添加到EKEve nt以编程方式,因为与会者是一个只读属性,所以你不能通过代码设置它的值,因为你不能直接通过代码创建EKParticipant对象。

But you can't add attendees to EKEvent programmatically since the attendees is a read- only property, so you ca't set it's value by code, and since you ca't create EKParticipant object directly by code.

即将推出的iOS版本可能会出现此限制更改。

may be this limitation change in coming versions of iOS.

这篇关于在EventKit中将EKParticipants添加到EKEvent的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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