In the EKParticipant Class reference, " Send attendees to an EKEvent object to get an array of EKParticipant objects. " OK, buy how can I send attendees to an EKEvent object?
Someone give example code?
The iOS reference says the following:
You do not create EKParticipant objects directly. Send attendees to an EKEvent object to get an array of EKParticipant objects.
Unfortunately that attendees
property is read-only and the ways that these EKParticipant
's come into existence is omitted from the reference. It has lead me to believe that the only way to create new participants, is by using the EKEventEditViewController
(from the EventKitUI
framework).
Very unsatisfying, I know, so please let there be someone else with a better answer!
The only way WeekCal can do this legally (via API contract) is by talking to the iCloud servers to add the attendees, which then get synced back down to the device. I'd love to see proof that it is touching the iOS event store...
You would always fail to create attendees by using EventKit this version because Apple has not get related APIs public.
But you can use class-dump to output EventKit header files to see all interfaces even included the private and try it out one by one.
I've seen an app called Week Cal could add attendees into iOS event store, and it is an Appstore-sale app and no jailbroken needed. So I believe that there is a way to add attendees into event store in current iOS and would not be rejected by Apple.
来源:https://stackoverflow.com/questions/10853610/add-participant-to-an-event-in-ios